feat: finishes revision restore

This commit is contained in:
James
2021-12-23 09:31:13 -05:00
parent 210488ba4e
commit 0e093bf15e
2 changed files with 4 additions and 16 deletions

View File

@@ -55,14 +55,8 @@ const DeleteDocument: React.FC<Props> = (props) => {
const json = await res.json();
if (res.status < 400) {
closeAll();
return history.push({
pathname: `${admin}/collections/${slug}`,
state: {
status: {
message: `${singular} "${title}" successfully deleted.`,
},
},
});
toast.success(`${singular} "${title}" successfully deleted.`);
return history.push(`${admin}/collections/${slug}`);
}
closeAll();

View File

@@ -41,14 +41,8 @@ const Restore: React.FC<Props> = ({ collection, global, className, revisionID, o
if (res.status === 200) {
const json = await res.json();
history.push({
pathname: redirectURL,
state: {
status: {
message: json.message,
},
},
});
toast.success(json.message);
history.push(redirectURL);
} else {
toast.error('There was a problem while restoring this revision.');
}