Skip to content

Commit

Permalink
[Style] Shorter function names
Browse files Browse the repository at this point in the history
References #18.
  • Loading branch information
angel-penchev committed Oct 20, 2021
1 parent 2567c1e commit 8e4d500
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
BadRequestException,
Body,
Controller,
Get,
HttpCode,
Expand Down Expand Up @@ -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,
);
Expand All @@ -61,7 +60,7 @@ export class CodeSnippetsController {
@PlainBody() body: string,
) {
try {
await this.codeSnippetsService.saveUserCodeSnippet(
await this.codeSnippetsService.saveCodeSnippet(
req.user['username'],
filepath,
body,
Expand Down
6 changes: 3 additions & 3 deletions server/src/code-snippets/services/code-snippets.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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('/')) {
Expand All @@ -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('/')) {
Expand Down

0 comments on commit 8e4d500

Please sign in to comment.