diff --git a/twake/backend/node/src/services/console/types.ts b/twake/backend/node/src/services/console/types.ts index 075b12c9b2..547f9e6750 100644 --- a/twake/backend/node/src/services/console/types.ts +++ b/twake/backend/node/src/services/console/types.ts @@ -194,6 +194,10 @@ export type ConsoleHookBodyContent = { user: ConsoleHookUser; }; +export type ConsoleHookCompanyDeletedContent = { + companyCode: string; +}; + export type ConsoleHookPreferenceContent = { preference: { targetCode: string; @@ -202,7 +206,11 @@ export type ConsoleHookPreferenceContent = { export type ConsoleHookBody = { type: string; - content: ConsoleHookBodyContent | ConsoleHookUser | ConsoleHookCompany; + content: + | ConsoleHookBodyContent + | ConsoleHookUser + | ConsoleHookCompany + | ConsoleHookCompanyDeletedContent; signature: string; secret_key?: string; }; diff --git a/twake/backend/node/src/services/console/web/controller.ts b/twake/backend/node/src/services/console/web/controller.ts index 821ebc8e11..d794dc3444 100644 --- a/twake/backend/node/src/services/console/web/controller.ts +++ b/twake/backend/node/src/services/console/web/controller.ts @@ -5,6 +5,7 @@ import { ConsoleHookBody, ConsoleHookBodyContent, ConsoleHookCompany, + ConsoleHookCompanyDeletedContent, ConsoleHookPreferenceContent, ConsoleHookResponse, ConsoleHookUser, @@ -192,7 +193,7 @@ export class ConsoleController { await this.planUpdated(request.body.content as ConsoleHookBodyContent); break; case "company_deleted": - await this.companyRemoved(request.body.content as ConsoleHookBodyContent); + await this.companyRemoved(request.body.content as ConsoleHookCompanyDeletedContent); break; case "company_created": await this.companyUpdated(request.body.content as ConsoleHookBodyContent); @@ -240,14 +241,12 @@ export class ConsoleController { await gr.services.console.processPendingUser(user); } - private async companyRemoved(content: ConsoleHookBodyContent) { - assert(content.company, "content.company is missing"); - assert(content.company.details, "content.company.details is missing"); - assert(content.company.details.code, "content.company.details.code is missing"); + private async companyRemoved(content: ConsoleHookCompanyDeletedContent) { + assert(content.companyCode, "content.companyCode is missing"); await gr.services.console.getClient().removeCompany({ identity_provider: "console", - identity_provider_id: content.company.details.code, + identity_provider_id: content.companyCode, }); } diff --git a/twake/frontend/src/tailwind.css b/twake/frontend/src/tailwind.css index d0ec9922b4..97fb26058d 100644 --- a/twake/frontend/src/tailwind.css +++ b/twake/frontend/src/tailwind.css @@ -23,6 +23,10 @@ a { color: var(--primary) !important; } +.ant-switch-checked { + background-color: #004dff !important; +} + @layer base { ul,ol { list-style: revert;