diff --git a/server/src/code-snippets/controllers/code-snippets.controller.ts b/server/src/code-snippets/controllers/code-snippets.controller.ts index ff3ff0d..95c53c7 100644 --- a/server/src/code-snippets/controllers/code-snippets.controller.ts +++ b/server/src/code-snippets/controllers/code-snippets.controller.ts @@ -1,6 +1,5 @@ import { BadRequestException, - Body, Controller, Get, HttpCode, @@ -39,11 +38,11 @@ export class CodeSnippetsController { path ??= ''; return path.endsWith('/') || path === '' - ? await this.codeSnippetsService.listUserCodeSnippets( + ? await this.codeSnippetsService.listCodeSnippets( req.user['username'], path, ) - : await this.codeSnippetsService.getUserCodeSnippet( + : await this.codeSnippetsService.getCodeSnippet( req.user['username'], path, ); @@ -61,7 +60,7 @@ export class CodeSnippetsController { @PlainBody() body: string, ) { try { - await this.codeSnippetsService.saveUserCodeSnippet( + await this.codeSnippetsService.saveCodeSnippet( req.user['username'], filepath, body, diff --git a/server/src/code-snippets/services/code-snippets.service.ts b/server/src/code-snippets/services/code-snippets.service.ts index bfa2e2e..cdde69b 100644 --- a/server/src/code-snippets/services/code-snippets.service.ts +++ b/server/src/code-snippets/services/code-snippets.service.ts @@ -9,7 +9,7 @@ import { CodeSnippetsErrorCode } from '../errors/code-snippets.error.code'; export class CodeSnippetsService { constructor(@InjectAwsService(S3) private readonly s3: S3) {} - async listUserCodeSnippets(username: string, subdirectory?: string) { + async listCodeSnippets(username: string, subdirectory?: string) { const tree = {}; const prefix = `${username}/${ subdirectory @@ -45,7 +45,7 @@ export class CodeSnippetsService { return tree; } - async getUserCodeSnippet(username: string, filepath: string) { + async getCodeSnippet(username: string, filepath: string) { const completeFilepath = `${username}/${filepath}`; if (completeFilepath.endsWith('/')) { @@ -70,7 +70,7 @@ export class CodeSnippetsService { }); } - async saveUserCodeSnippet(username: string, filepath: string, body: string) { + async saveCodeSnippet(username: string, filepath: string, body: string) { const completeFilepath = `${username}/${filepath}`; if (completeFilepath.endsWith('/')) {