Skip to content

Commit

Permalink
sync with core
Browse files Browse the repository at this point in the history
  • Loading branch information
zAlweNy26 committed Jul 16, 2023
1 parent b9c4d6c commit 9400f12
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 50 deletions.
5 changes: 5 additions & 0 deletions .changeset/red-shrimps-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ccat-api": patch
---

Sync with Cheshire Cat Core
3 changes: 2 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ module.exports = {
rules: {
"no-throw-literal": "off",
"@typescript-eslint/no-throw-literal": "error",
"@typescript-eslint/no-explicit-any": "warn"
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/ban-tslint-comment": "off"
},
root: true,
};
4 changes: 1 addition & 3 deletions api/models/Setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ export type Setting = {
name: string;
value: Record<string, any>;
category?: string;
enabled?: boolean;
createdAt?: string;
updatedAt?: string;
updated_at?: number;
};
10 changes: 2 additions & 8 deletions api/services/SettingsGeneralService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,17 @@ export class SettingsGeneralService {
/**
* Get Settings
* Get the entire list of settings available in the database
* @param limit The maximum number of settings to fetch
* @param page The number of settings' page to fetch
* @param search The setting to search
* @returns SettingsList Successful Response
* @throws ApiError
*/
public getSettings(
limit: number = 100,
page: number = 1,
search: string = '',
): CancelablePromise<SettingsList> {
return this.httpRequest.request({
method: 'GET',
url: '/settings/',
query: {
'limit': limit,
'page': page,
'search': search,
},
errors: {
Expand Down Expand Up @@ -108,7 +102,7 @@ settingId: string,

/**
* Update Setting
* Update a specific setting in the database
* Update a specific setting in the database if it exists
* @param settingId
* @param requestBody
* @returns SettingResponse Successful Response
Expand All @@ -119,7 +113,7 @@ settingId: string,
requestBody: Setting,
): CancelablePromise<SettingResponse> {
return this.httpRequest.request({
method: 'PATCH',
method: 'PUT',
url: '/settings/{settingId}',
path: {
'settingId': settingId,
Expand Down
43 changes: 5 additions & 38 deletions catapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,6 @@
"description": "Get the entire list of settings available in the database",
"operationId": "get_settings",
"parameters": [
{
"required": false,
"schema": {
"title": "Limit",
"type": "integer",
"default": 100
},
"description": "The maximum number of settings to fetch",
"name": "limit",
"in": "query"
},
{
"required": false,
"schema": {
"title": "Page",
"type": "integer",
"default": 1
},
"description": "The number of settings' page to fetch",
"name": "page",
"in": "query"
},
{
"required": false,
"schema": {
Expand Down Expand Up @@ -224,12 +202,12 @@
},
"security": []
},
"patch": {
"put": {
"tags": [
"Settings - General"
],
"summary": "Update Setting",
"description": "Update a specific setting in the database",
"description": "Update a specific setting in the database if it exists",
"operationId": "update_setting",
"parameters": [
{
Expand Down Expand Up @@ -1470,20 +1448,9 @@
"type": "string",
"default": "general"
},
"enabled": {
"title": "Enabled",
"type": "boolean",
"default": true
},
"createdAt": {
"title": "Createdat",
"type": "string",
"format": "date-time"
},
"updatedAt": {
"title": "Updatedat",
"type": "string",
"format": "date-time"
"updated_at": {
"title": "Updated Timestamp",
"type": "number"
}
}
},
Expand Down

0 comments on commit 9400f12

Please sign in to comment.