add: app data rename method

This commit is contained in:
trisua 2025-07-19 23:21:01 -04:00
parent 35b66c94d0
commit 6f2d556c65
10 changed files with 100 additions and 12 deletions

View file

@ -140,6 +140,29 @@ export default function tetratto({
);
}
async function rename(id, key) {
if (!api_key) {
throw Error("No API key provided.");
}
return api_promise(
json_parse(
await (
await fetch(`${host}/api/v1/app_data/${id}/key`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Atto-Secret-Key": api_key,
},
body: json_stringify({
key,
}),
})
).text(),
),
);
}
async function remove(id) {
if (!api_key) {
throw Error("No API key provided.");
@ -265,6 +288,7 @@ export default function tetratto({
query,
insert,
update,
rename,
remove,
remove_query,
// user connection