Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Jul 29, 2020
1 parent 8d8117f commit 69fb152
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
37 changes: 36 additions & 1 deletion public/openapi/read.yaml
Expand Up @@ -634,7 +634,42 @@ paths:
content:
application/json:
schema:
$ref: components/schemas/CommonProps.yaml#/CommonProps
allOf:
- type : object
properties:
categories:
type: array
items:
type: object
properties:
cid:
type: number
description: A category identifier
name:
type: string
disabled:
type: number
icon:
type: string
link:
type: string
parentCid:
type: number
description: The category identifier for the category that is the immediate
ancestor of the current category
color:
type: string
bgColor:
type: string
backgroundImage:
type: string
nullable: true
imageClass:
type: string
children:
type: array
description: Array of children categories
- $ref: components/schemas/CommonProps.yaml#/CommonProps
"/api/admin/manage/categories/{category_id}":
get:
tags:
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/admin/categories.js
Expand Up @@ -47,7 +47,7 @@ categoriesController.getAll = async function (req, res) {
// Categories list will be rendered on client side with recursion, etc.
const cids = await categories.getAllCidsFromSet('categories:cid');
const fields = [
'cid', 'name', 'level', 'icon', 'parentCid', 'disabled', 'link',
'cid', 'name', 'icon', 'parentCid', 'disabled', 'link',
'color', 'bgColor', 'backgroundImage', 'imageClass',
];
const categoriesData = await categories.getCategoriesFields(cids, fields);
Expand Down
2 changes: 1 addition & 1 deletion src/socket.io/admin/categories.js
Expand Up @@ -23,7 +23,7 @@ Categories.getAll = async function () {
winston.warn('[deprecated] admin.categories.getAll deprecated, data is returned in the api route');
const cids = await categories.getAllCidsFromSet('categories:cid');
const fields = [
'cid', 'name', 'level', 'icon', 'parentCid', 'disabled', 'link',
'cid', 'name', 'icon', 'parentCid', 'disabled', 'link',
'color', 'bgColor', 'backgroundImage', 'imageClass',
];
const categoriesData = await categories.getCategoriesFields(cids, fields);
Expand Down

0 comments on commit 69fb152

Please sign in to comment.