File tree Expand file tree Collapse file tree 2 files changed +35
-33
lines changed
apps/meteor/app/api/server/v1
packages/rest-typings/src/v1 Expand file tree Collapse file tree 2 files changed +35
-33
lines changed Original file line number Diff line number Diff line change 11import type { ICustomSound } from '@rocket.chat/core-typings' ;
22import { CustomSounds } from '@rocket.chat/models' ;
3- import type { PaginatedRequest , PaginatedResult } from '@rocket.chat/rest-typings' ;
3+ import type { PaginatedResult } from '@rocket.chat/rest-typings' ;
44import {
55 isCustomSoundsGetOneProps ,
6+ isCustomSoundsListProps ,
67 ajv ,
78 validateBadRequestErrorResponse ,
89 validateNotFoundErrorResponse ,
@@ -15,38 +16,6 @@ import type { ExtractRoutesFromAPI } from '../ApiClass';
1516import { API } from '../api' ;
1617import { getPaginationItems } from '../helpers/getPaginationItems' ;
1718
18- type CustomSoundsList = PaginatedRequest < { name ?: string } > ;
19-
20- const CustomSoundsListSchema = {
21- type : 'object' ,
22- properties : {
23- count : {
24- type : 'number' ,
25- nullable : true ,
26- } ,
27- offset : {
28- type : 'number' ,
29- nullable : true ,
30- } ,
31- sort : {
32- type : 'string' ,
33- nullable : true ,
34- } ,
35- name : {
36- type : 'string' ,
37- nullable : true ,
38- } ,
39- query : {
40- type : 'string' ,
41- nullable : true ,
42- } ,
43- } ,
44- required : [ ] ,
45- additionalProperties : false ,
46- } ;
47-
48- export const isCustomSoundsListProps = ajv . compile < CustomSoundsList > ( CustomSoundsListSchema ) ;
49-
5019const customSoundsEndpoints = API . v1
5120 . get (
5221 'custom-sounds.list' ,
Original file line number Diff line number Diff line change 11import type { ICustomSound } from '@rocket.chat/core-typings' ;
22
33import { ajv } from './Ajv' ;
4+ import { type PaginatedRequest } from '../helpers/PaginatedRequest' ;
45
56type CustomSoundsGetOne = { _id : ICustomSound [ '_id' ] } ;
67
@@ -17,3 +18,35 @@ const CustomSoundsGetOneSchema = {
1718} ;
1819
1920export const isCustomSoundsGetOneProps = ajv . compile < CustomSoundsGetOne > ( CustomSoundsGetOneSchema ) ;
21+
22+ type CustomSoundsList = PaginatedRequest < { name ?: string } > ;
23+
24+ const CustomSoundsListSchema = {
25+ type : 'object' ,
26+ properties : {
27+ count : {
28+ type : 'number' ,
29+ nullable : true ,
30+ } ,
31+ offset : {
32+ type : 'number' ,
33+ nullable : true ,
34+ } ,
35+ sort : {
36+ type : 'string' ,
37+ nullable : true ,
38+ } ,
39+ name : {
40+ type : 'string' ,
41+ nullable : true ,
42+ } ,
43+ query : {
44+ type : 'string' ,
45+ nullable : true ,
46+ } ,
47+ } ,
48+ required : [ ] ,
49+ additionalProperties : false ,
50+ } ;
51+
52+ export const isCustomSoundsListProps = ajv . compile < CustomSoundsList > ( CustomSoundsListSchema ) ;
You can’t perform that action at this time.
0 commit comments