This repository has been archived by the owner on May 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add search tags route and fix updating tags in ruleset (#88)
* Add search tags route and fix updating tags in ruleset * Add take query * Search with startsWith instead of include * Add usageCount to tag
- Loading branch information
1 parent
63670c9
commit 73ba813
Showing
3 changed files
with
91 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { Controller, Get } from '@nestjs/common'; | ||
import { Controller, Get, Query } from '@nestjs/common'; | ||
import { TagService } from './tag.service'; | ||
|
||
@Controller('tag') | ||
export class TagController { | ||
constructor(private readonly tagService: TagService) {} | ||
|
||
@Get() | ||
async getAllTags() { | ||
return await this.tagService.getAllTags(); | ||
async searchTags(@Query('search') search: string, @Query('take') take = 10) { | ||
return await this.tagService.searchTags(search, take); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters