File size: 1,074 Bytes
aa2e6af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const { logger } = require('~/config');
// const { Categories } = require('./schema/categories');
const options = [
  {
    label: '',
    value: '',
  },
  {
    label: 'idea',
    value: 'idea',
  },
  {
    label: 'travel',
    value: 'travel',
  },
  {
    label: 'teach_or_explain',
    value: 'teach_or_explain',
  },
  {
    label: 'write',
    value: 'write',
  },
  {
    label: 'shop',
    value: 'shop',
  },
  {
    label: 'code',
    value: 'code',
  },
  {
    label: 'misc',
    value: 'misc',
  },
  {
    label: 'roleplay',
    value: 'roleplay',
  },
  {
    label: 'finance',
    value: '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 [];
    }
  },
};