LibreChat/api/models/Categories.js
Ruben Talstra 04c2a5abe7
🌍 fix: Enhance i18n Support & Optimize Category Handling (#5866)
* fix: Missing Translations in Prompt Filters in Prompt Library

* fix: fixed issue with `zh`
feat: added `Estonian` language option

* fix: test for `i18n.ts`

* refactor: `pt` --> `pt-BR` and `pt-PT`

* feat: request access to another language. default is only one language during invite.
2025-02-14 08:30:27 -05:00

58 lines
1.1 KiB
JavaScript

const { logger } = require('~/config');
// const { Categories } = require('./schema/categories');
const options = [
{
label: 'idea',
value: 'com_ui_idea',
},
{
label: 'travel',
value: 'com_ui_travel',
},
{
label: 'teach_or_explain',
value: 'com_ui_teach_or_explain',
},
{
label: 'write',
value: 'com_ui_write',
},
{
label: 'shop',
value: 'com_ui_shop',
},
{
label: 'code',
value: 'com_ui_code',
},
{
label: 'misc',
value: 'com_ui_misc',
},
{
label: 'roleplay',
value: 'com_ui_roleplay',
},
{
label: 'finance',
value: 'com_ui_finance',
},
];
module.exports = {
/**
* Retrieves the categories asynchronously.
* @returns {Promise<TGetCategoriesResponse>} An array of category objects.
* @throws {Error} If there is an error retrieving the categories.
*/
getCategories: async () => {
try {
// const categories = await Categories.find();
return options;
} catch (error) {
logger.error('Error getting categories', error);
return [];
}
},
};