add expiration_ttl for kv storage

This commit is contained in:
lloydzhou
2024-07-25 16:56:08 +08:00
parent 7c1bc1f1a1
commit d8afd1af88
3 changed files with 32 additions and 7 deletions

View File

@@ -180,8 +180,17 @@ export function Artifact() {
useEffect(() => {
if (id) {
fetch(`${ApiPath.Artifact}?id=${id}`)
.then((res) => {
if (res.status > 300) {
throw Error("can not get content");
}
return res;
})
.then((res) => res.text())
.then(setCode);
.then(setCode)
.catch((e) => {
showToast(Locale.Export.Artifact.Error);
});
}
}, [id]);