Implemented search result page (#37)

This commit is contained in:
Alex 2022-03-02 16:44:24 -06:00 committed by GitHub
parent bd34be92e6
commit 5990a28870
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 467 additions and 17 deletions

View file

@ -28,6 +28,7 @@ import { Response as Res } from 'express';
import { GetNewAssetQueryDto } from './dto/get-new-asset-query.dto';
import { BackgroundTaskService } from '../../modules/background-task/background-task.service';
import { DeleteAssetDto } from './dto/delete-asset.dto';
import { SearchAssetDto } from './dto/search-asset.dto';
@UseGuards(JwtAuthGuard)
@Controller('asset')
@ -76,6 +77,11 @@ export class AssetController {
return this.assetService.getAssetSearchTerm(authUser);
}
@Post('/search')
async searchAsset(@GetAuthUser() authUser: AuthUserDto, @Body(ValidationPipe) searchAssetDto: SearchAssetDto) {
return this.assetService.searchAsset(authUser, searchAssetDto);
}
@Get('/new')
async getNewAssets(@GetAuthUser() authUser: AuthUserDto, @Query(ValidationPipe) query: GetNewAssetQueryDto) {
return await this.assetService.getNewAssets(authUser, query.latestDate);