mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-22 01:53:33 +00:00
📸 refactor: Refresh Shared Links With Latest Snapshot (#13095)
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
GitNexus Index / index (push) Waiting to run
GitNexus Index / post-index (push) Blocked by required conditions
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
GitNexus Index / index (push) Waiting to run
GitNexus Index / post-index (push) Blocked by required conditions
* fix: refresh shared links with latest target * fix: validate shared link refresh payload
This commit is contained in:
parent
7f58e4c2ed
commit
ae75fb68a6
10 changed files with 150 additions and 20 deletions
|
|
@ -92,7 +92,7 @@ export default function SharedLinkButton({
|
|||
if (!shareId) {
|
||||
return;
|
||||
}
|
||||
const updateShare = await mutateAsync({ shareId });
|
||||
const updateShare = await mutateAsync({ shareId, targetMessageId });
|
||||
const newLink = generateShareLink(updateShare.shareId);
|
||||
setSharedLink(newLink);
|
||||
setAnnouncement(localize('com_ui_link_refreshed'));
|
||||
|
|
|
|||
|
|
@ -176,17 +176,17 @@ export const useCreateSharedLinkMutation = (
|
|||
};
|
||||
|
||||
export const useUpdateSharedLinkMutation = (
|
||||
options?: t.MutationOptions<t.TUpdateShareLinkRequest, { shareId: string }>,
|
||||
): UseMutationResult<t.TSharedLinkResponse, unknown, { shareId: string }, unknown> => {
|
||||
options?: t.MutationOptions<t.TUpdateShareLinkRequest, t.TUpdateShareLinkRequest>,
|
||||
): UseMutationResult<t.TSharedLinkResponse, unknown, t.TUpdateShareLinkRequest, unknown> => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const { onSuccess, ..._options } = options || {};
|
||||
return useMutation(
|
||||
({ shareId }) => {
|
||||
({ shareId, targetMessageId }) => {
|
||||
if (!shareId) {
|
||||
throw new Error('Share ID is required');
|
||||
}
|
||||
return dataService.updateSharedLink(shareId);
|
||||
return dataService.updateSharedLink(shareId, targetMessageId);
|
||||
},
|
||||
{
|
||||
onSuccess: (_data: t.TSharedLinkResponse, vars, context) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue