mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-08 15:22:05 +00:00
fix: thread retention config through conversation pin route
This commit is contained in:
parent
b96c25abbb
commit
40b8e3d2ef
2 changed files with 8 additions and 4 deletions
|
|
@ -574,7 +574,7 @@ describe('Convos Routes', () => {
|
|||
expect(response.status).toBe(200);
|
||||
expect(response.body).toEqual(mockPinnedConvo);
|
||||
expect(saveConvo).toHaveBeenCalledWith(
|
||||
{ userId: 'test-user-123' },
|
||||
expect.objectContaining({ userId: 'test-user-123' }),
|
||||
{ conversationId: mockConversationId, pinned: true },
|
||||
{ context: `POST /api/convos/pin ${mockConversationId}` },
|
||||
);
|
||||
|
|
@ -589,7 +589,7 @@ describe('Convos Routes', () => {
|
|||
expect(response.status).toBe(200);
|
||||
expect(response.body).toEqual(mockUnpinnedConvo);
|
||||
expect(saveConvo).toHaveBeenCalledWith(
|
||||
{ userId: 'test-user-123' },
|
||||
expect.objectContaining({ userId: 'test-user-123' }),
|
||||
{ conversationId: mockConversationId, pinned: false },
|
||||
{ context: `POST /api/convos/pin ${mockConversationId}` },
|
||||
);
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ router.post('/archive', validateConvoAccess, configMiddleware, async (req, res)
|
|||
}
|
||||
});
|
||||
|
||||
router.post('/pin', validateConvoAccess, async (req, res) => {
|
||||
router.post('/pin', validateConvoAccess, configMiddleware, async (req, res) => {
|
||||
const { conversationId, pinned } = req.body?.arg ?? {};
|
||||
|
||||
if (!conversationId) {
|
||||
|
|
@ -219,7 +219,11 @@ router.post('/pin', validateConvoAccess, async (req, res) => {
|
|||
|
||||
try {
|
||||
const dbResponse = await db.saveConvo(
|
||||
{ userId: req.user.id },
|
||||
{
|
||||
userId: req.user.id,
|
||||
isTemporary: req?.body?.isTemporary,
|
||||
interfaceConfig: req?.config?.interfaceConfig,
|
||||
},
|
||||
{ conversationId, pinned },
|
||||
{ context: `POST /api/convos/pin ${conversationId}` },
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue