mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-05 22:38:48 +00:00
fixes
This commit is contained in:
parent
72b51f6165
commit
4dbd361625
3 changed files with 24 additions and 12 deletions
|
|
@ -3,13 +3,13 @@ import { authHeader, handleResponse, handleResponseWithoutValidation } from '@/_
|
|||
|
||||
function save(body) {
|
||||
const requestOptions = { method: 'POST', headers: authHeader(), credentials: 'include', body: JSON.stringify(body) };
|
||||
return fetch(`${config.apiUrl}/custom-styles/`, requestOptions).then(handleResponse);
|
||||
return fetch(`${config.apiUrl}/custom-styles`, requestOptions).then(handleResponse);
|
||||
}
|
||||
|
||||
function get(validateResponse = true) {
|
||||
const requestOptions = { method: 'GET', headers: authHeader(), credentials: 'include' };
|
||||
const handleOutput = validateResponse ? handleResponse : handleResponseWithoutValidation;
|
||||
return fetch(`${config.apiUrl}/custom-styles/`, requestOptions).then(handleOutput);
|
||||
return fetch(`${config.apiUrl}/custom-styles`, requestOptions).then(handleOutput);
|
||||
}
|
||||
|
||||
function getForAppViewerEditor(validateResponse = true) {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import { ImportExportResourcesModule } from '@modules/import-export-resources/mo
|
|||
import { TooljetDbModule } from '@modules/tooljet-db/module';
|
||||
import { WorkflowsModule } from '@modules/workflows/module';
|
||||
import { AiModule } from '@modules/ai/module';
|
||||
import { CustomStylesModule } from '@modules/custom-styles/module';
|
||||
|
||||
export class AppModule implements OnModuleInit {
|
||||
static async register(configs: { IS_GET_CONTEXT: boolean }): Promise<DynamicModule> {
|
||||
|
|
@ -92,6 +93,7 @@ export class AppModule implements OnModuleInit {
|
|||
await TooljetDbModule.register(configs),
|
||||
await WorkflowsModule.register(configs),
|
||||
await AiModule.register(configs),
|
||||
await CustomStylesModule.register(configs),
|
||||
];
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,21 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { CustomStylesController } from '@modules/custom-styles/controller';
|
||||
import { CustomStylesService } from '@modules/custom-styles/service';
|
||||
import { DynamicModule } from '@nestjs/common';
|
||||
import { getImportPath } from '@modules/app/constants';
|
||||
import { OrganizationsModule } from '@modules/organizations/module';
|
||||
import { FeatureAbilityFactory } from './ability';
|
||||
import { OrganizationRepository } from '@modules/organizations/repository';
|
||||
import { AppsRepository } from '@modules/apps/repository';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
providers: [CustomStylesService],
|
||||
controllers: [CustomStylesController],
|
||||
exports: [],
|
||||
})
|
||||
export class CustomStylesModule {}
|
||||
export class CustomStylesModule {
|
||||
static async register(configs?: { IS_GET_CONTEXT: boolean }): Promise<DynamicModule> {
|
||||
const importPath = await getImportPath(configs?.IS_GET_CONTEXT);
|
||||
const { CustomStylesController } = await import(`${importPath}/custom-styles/controller`);
|
||||
const { CustomStylesService } = await import(`${importPath}/custom-styles/service`);
|
||||
return {
|
||||
module: CustomStylesModule,
|
||||
imports: [await OrganizationsModule.register(configs)],
|
||||
providers: [CustomStylesService, FeatureAbilityFactory, OrganizationRepository, AppsRepository],
|
||||
controllers: [CustomStylesController],
|
||||
exports: [],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue