Commit 7f7c31ca authored by nanahira's avatar nanahira

fix

parent 77ad10bc
Pipeline #6552 passed with stages
in 13 minutes and 30 seconds
...@@ -23,6 +23,6 @@ export class AppController { ...@@ -23,6 +23,6 @@ export class AppController {
@Param('workspaceName') workspaceName: string, @Param('workspaceName') workspaceName: string,
@Param('name') name: string, @Param('name') name: string,
) { ) {
return this.appService.getAdArray('workspaceName', name); return this.appService.getAdArray(workspaceName, name);
} }
} }
...@@ -46,7 +46,7 @@ export class AppService extends ConsoleLogger { ...@@ -46,7 +46,7 @@ export class AppService extends ConsoleLogger {
async getAdArray(workspaceName: string, name: string) { async getAdArray(workspaceName: string, name: string) {
const workspace = this.workspaceService.getWorkspace(workspaceName); const workspace = this.workspaceService.getWorkspace(workspaceName);
if (!workspace) { if (!workspace) {
throw new BlankReturnMessageDto(404, 'file not found').toException(); throw new BlankReturnMessageDto(404, 'workspace not found').toException();
} }
const ads = await this.getAd(workspace, name); const ads = await this.getAd(workspace, name);
return _.flatten( return _.flatten(
......
...@@ -9,8 +9,8 @@ export class WorkspaceService extends ConsoleLogger { ...@@ -9,8 +9,8 @@ export class WorkspaceService extends ConsoleLogger {
constructor(private config: ConfigService) { constructor(private config: ConfigService) {
super('workspace'); super('workspace');
const entries = Object.entries( const entries = Object.entries(
this.config.get<Workspace>('workspaces'), this.config.get<Record<string, Workspace>>('workspaces'),
) as [string, Workspace][]; );
this.workspaceMap = new Map(entries); this.workspaceMap = new Map(entries);
const defaultEntry = entries.find((e) => e[1].default); const defaultEntry = entries.find((e) => e[1].default);
if (defaultEntry) { if (defaultEntry) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment