add: app data rename method
This commit is contained in:
parent
35b66c94d0
commit
6f2d556c65
10 changed files with 100 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue