feat(web): reactively update shared link expiration (#22274)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>pull/21071/merge
parent
719bf763e4
commit
0a6b2ad26e
|
|
@ -103,7 +103,7 @@
|
|||
try {
|
||||
const expirationDate = expirationOption > 0 ? DateTime.now().plus(expirationOption).toISO() : null;
|
||||
|
||||
await updateSharedLink({
|
||||
const updatedLink = await updateSharedLink({
|
||||
id: editingLink.id,
|
||||
sharedLinkEditDto: {
|
||||
description,
|
||||
|
|
@ -121,7 +121,7 @@
|
|||
message: $t('edited'),
|
||||
});
|
||||
|
||||
onClose();
|
||||
onClose(updatedLink);
|
||||
} catch (error) {
|
||||
handleError(error, $t('errors.failed_to_edit_shared_link'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,8 +54,15 @@
|
|||
}
|
||||
};
|
||||
|
||||
const handleEditDone = async () => {
|
||||
await refresh();
|
||||
const handleEditDone = async (updatedLink?: SharedLinkResponseDto) => {
|
||||
if (updatedLink) {
|
||||
const index = sharedLinks.findIndex((link) => link.id === updatedLink.id);
|
||||
if (index !== -1) {
|
||||
sharedLinks[index] = updatedLink;
|
||||
}
|
||||
} else {
|
||||
await refresh();
|
||||
}
|
||||
await goto(AppRoute.SHARED_LINKS);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue