📸 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

* fix: refresh shared links with latest target

* fix: validate shared link refresh payload
This commit is contained in:
Danny Avila 2026-05-13 19:38:28 -04:00 committed by GitHub
parent 7f58e4c2ed
commit ae75fb68a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 150 additions and 20 deletions

View file

@ -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 {