mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
fix: model menu key issue
This commit is contained in:
parent
9bc85ea83d
commit
8e513d83a5
6 changed files with 73 additions and 57 deletions
|
|
@ -1,9 +1,14 @@
|
|||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const { getCustomGpts, updateCustomGpt, updateByLabel, deleteCustomGpts } = require('../../models');
|
||||
const {
|
||||
getCustomGpts,
|
||||
updateCustomGpt,
|
||||
updateByLabel,
|
||||
deleteCustomGpts
|
||||
} = require('../../models');
|
||||
|
||||
router.get('/', async (req, res) => {
|
||||
const models = (await getCustomGpts()).map(model => {
|
||||
const models = (await getCustomGpts()).map((model) => {
|
||||
model = model.toObject();
|
||||
model._id = model._id.toString();
|
||||
return model;
|
||||
|
|
@ -15,8 +20,14 @@ router.post('/delete', async (req, res) => {
|
|||
const { arg } = req.body;
|
||||
|
||||
try {
|
||||
const dbResponse = await deleteCustomGpts(arg);
|
||||
res.status(201).send(dbResponse);
|
||||
await deleteCustomGpts(arg);
|
||||
const models = (await getCustomGpts()).map((model) => {
|
||||
model = model.toObject();
|
||||
model._id = model._id.toString();
|
||||
return model;
|
||||
});
|
||||
res.status(201).send(models);
|
||||
// res.status(201).send(dbResponse);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
res.status(500).send(error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue