Skip to content

Commit dcff75e

Browse files
committed
rename function createTiny url to shortenUrl
1 parent a72cc04 commit dcff75e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

api/src/shorten-url/shorten-url.controller.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ export class ShortenUrlController {
1111
@Body() request: CreateShortenUrlDto,
1212
): Promise<{ shortenedUrl: string }> {
1313
Logger.log(`Received url ${request.url} to shorten`);
14-
const shortenedUrl = await this.shortenUrlUsecase.createTinyURL(
15-
request.url,
16-
);
14+
// TODO perhaps it is worth converting the URL from string to URL object
15+
const shortenedUrl = await this.shortenUrlUsecase.shortenUrl(request.url);
1716
return { shortenedUrl };
1817
}
1918
}

api/src/shorten-url/shorten-url.usecase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class ShortenUrlUsecase {
2626
this.configService.get<string>('SHORTENED_BASE_URL');
2727
}
2828

29-
async createTinyURL(originalURL: string): Promise<string> {
29+
async shortenUrl(originalURL: string): Promise<string> {
3030
const existingShortenedUrl = await this.shortenUrlRepository.findURL(
3131
originalURL,
3232
);

0 commit comments

Comments
 (0)