feat: finishes revision restore
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user