File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments