File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
src/SwiftLink.Presentation/Controllers Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,17 @@ public async Task<IActionResult> Shorten([FromBody] GenerateShortCodeCommand com
1616 [ HttpGet , Route ( "/api/{shortCode}" ) ] //TODO: this routing should be removed.
1717 [ ShortenEndpointFilter ]
1818 public async Task < IActionResult > Shorten ( string shortCode , [ FromQuery ] string password , CancellationToken cancellationToken = default )
19- => OK ( await _mediarR . Send ( new VisitShortenLinkQuery ( )
20- {
21- ShortCode = shortCode ,
22- Password = password ,
23- ClientMetaData = string . Empty
24- } , cancellationToken ) ) ;
19+ {
20+ var response = await _mediarR . Send ( new VisitShortenLinkQuery ( )
21+ {
22+ ShortCode = shortCode ,
23+ Password = password ,
24+ ClientMetaData = string . Empty
25+ } , cancellationToken ) ;
26+
27+ if ( response . IsSuccess )
28+ return Redirect ( response . Data ) ;
29+
30+ return Ok ( response ) ;
31+ }
2532}
You can’t perform that action at this time.
0 commit comments