moved api from monorepo
This commit is contained in:
12
utils/getTag.js
Normal file
12
utils/getTag.js
Normal file
@ -0,0 +1,12 @@
|
||||
import Game from '../models/Game.js'
|
||||
|
||||
const getTag = async (tag) => {
|
||||
const fullTags = await Game.find().distinct(tag)
|
||||
let tags = []
|
||||
for (let i = 0; i < fullTags.length; i++) {
|
||||
if (fullTags[i] !== '') tags.push(fullTags[i])
|
||||
}
|
||||
return tags
|
||||
}
|
||||
|
||||
export default getTag
|
Reference in New Issue
Block a user