init
This commit is contained in:
commit
fa6a4c650f
93 files changed
+6555
No files matched your search
@@ -0,0 +1,44 @@
|
||||
console.log("revisions.js loaded")
|
||||
|
||||
async function restoreRevision(
|
||||
revisionUUID,
|
||||
) {
|
||||
|
||||
if (
|
||||
!confirm(
|
||||
"restore revision?"
|
||||
)
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
const res = await fetch(
|
||||
"/_/api/v1/revisions/restore",
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type":
|
||||
"application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
revision_uuid:
|
||||
revisionUUID,
|
||||
}),
|
||||
},
|
||||
)
|
||||
|
||||
if (!res.ok) {
|
||||
|
||||
alert(
|
||||
"restore failed",
|
||||
)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
alert(
|
||||
"revision restored",
|
||||
)
|
||||
|
||||
location.reload()
|
||||
}
|
||||
Reference in new issue
Block a user