mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 06:52:47 +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
|
|
@ -87,6 +87,7 @@ router.get('/link/:conversationId', requireJwtAuth, async (req, res) => {
|
|||
return res.status(200).json({
|
||||
success: share.success,
|
||||
shareId: share.shareId,
|
||||
targetMessageId: share.targetMessageId,
|
||||
conversationId: req.params.conversationId,
|
||||
});
|
||||
} catch (error) {
|
||||
|
|
@ -112,7 +113,12 @@ router.post('/:conversationId', requireJwtAuth, async (req, res) => {
|
|||
|
||||
router.patch('/:shareId', requireJwtAuth, async (req, res) => {
|
||||
try {
|
||||
const updatedShare = await updateSharedLink(req.user.id, req.params.shareId);
|
||||
const { targetMessageId } = req.body ?? {};
|
||||
if (targetMessageId !== undefined && typeof targetMessageId !== 'string') {
|
||||
return res.status(400).json({ message: 'targetMessageId must be a string' });
|
||||
}
|
||||
|
||||
const updatedShare = await updateSharedLink(req.user.id, req.params.shareId, targetMessageId);
|
||||
if (updatedShare) {
|
||||
res.status(200).json(updatedShare);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue