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 {
@Param('workspaceName') workspaceName: 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 {
async getAdArray(workspaceName: string, name: string) {
const workspace = this.workspaceService.getWorkspace(workspaceName);
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);
return _.flatten(
......
......@@ -9,8 +9,8 @@ export class WorkspaceService extends ConsoleLogger {
constructor(private config: ConfigService) {
super('workspace');
const entries = Object.entries(
this.config.get<Workspace>('workspaces'),
) as [string, Workspace][];
this.config.get<Record<string, Workspace>>('workspaces'),
);
this.workspaceMap = new Map(entries);
const defaultEntry = entries.find((e) => e[1].default);
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