Skip to content

Commit

Permalink
fix(identifiers & weblinks): update route, avoid error 500 from server
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihoub2 committed Jan 19, 2024
1 parent 92f0281 commit fc91aa7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/api/identifiers/identifier.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import express from 'express';
import controllers from '../commons/middlewares/crud.middlewares';
import { identifiersRepository as repository } from '../commons/repositories';
import { identifiers as resource } from '../resources';
import { readQuery } from '../commons/queries/identifiers.query';

const router = new express.Router();

router.route(`/${resource}`)
.get(controllers.list(repository));
.get(controllers.list(repository, readQuery));

export default router;
3 changes: 2 additions & 1 deletion src/api/weblinks/weblinks.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import express from 'express';
import controllers from '../commons/middlewares/crud.middlewares';
import { weblinksRepository as repository } from '../commons/repositories';
import { weblinks as resource } from '../resources';
import { readQuery } from '../commons/queries/weblinks.query';

const router = new express.Router();

router.route(`/${resource}`)
.get(controllers.list(repository));
.get(controllers.list(repository, readQuery));

export default router;
15 changes: 5 additions & 10 deletions src/openapi/schemas/weblinks/weblinks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,15 @@ allOf:
resourceId:
type: string
readOnly: true
description: Unique resource identifier
description: Unique parent resource identifier
pattern: '^[a-zA-Z0-9]{5}$'
type:
$ref: ../../api.yml#/components/schemas/WeblinksEnum
value:
url:
type: string
active:
type: boolean
startDate:
language:
type: string
description: Language of the web link on 2 letters
pattern: '^[a-zA-Z]{2}$'
nullable: true
pattern: '((^$)|(^\d{4}$)|(^\d{4}-(0[1-9]|1[0-2]))|(^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$))'
endDate:
type: string
nullable: true
pattern: '((^$)|(^\d{4}$)|(^\d{4}-(0[1-9]|1[0-2]))|(^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$))'
- $ref: '../../api.yml#/components/schemas/Metas'

0 comments on commit fc91aa7

Please sign in to comment.