mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-03-01 12:44:37 +00:00
lint
This commit is contained in:
parent
e036678dbc
commit
c3aa23ad12
@ -147,7 +147,11 @@ const multiSearchMap = [
|
|||||||
export default {
|
export default {
|
||||||
Query: {
|
Query: {
|
||||||
searchPosts: (_parent, args, context, _resolveInfo) => {
|
searchPosts: (_parent, args, context, _resolveInfo) => {
|
||||||
const { query, postsOffset, firstPosts } = args as { query: string; postsOffset: number; firstPosts: number }
|
const { query, postsOffset, firstPosts } = args as {
|
||||||
|
query: string
|
||||||
|
postsOffset: number
|
||||||
|
firstPosts: number
|
||||||
|
}
|
||||||
let userId = null
|
let userId = null
|
||||||
if (context.user) userId = context.user.id
|
if (context.user) userId = context.user.id
|
||||||
return {
|
return {
|
||||||
@ -170,7 +174,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchUsers: (_parent, args, context, _resolveInfo) => {
|
searchUsers: (_parent, args, context, _resolveInfo) => {
|
||||||
const { query, usersOffset, firstUsers } = args as { query: string; usersOffset: number; firstUsers: number }
|
const { query, usersOffset, firstUsers } = args as {
|
||||||
|
query: string
|
||||||
|
usersOffset: number
|
||||||
|
firstUsers: number
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
userCount: getSearchResults(
|
userCount: getSearchResults(
|
||||||
context,
|
context,
|
||||||
@ -189,7 +197,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchHashtags: (_parent, args, context, _resolveInfo) => {
|
searchHashtags: (_parent, args, context, _resolveInfo) => {
|
||||||
const { query, hashtagsOffset, firstHashtags } = args as { query: string; hashtagsOffset: number; firstHashtags: number }
|
const { query, hashtagsOffset, firstHashtags } = args as {
|
||||||
|
query: string
|
||||||
|
hashtagsOffset: number
|
||||||
|
firstHashtags: number
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
hashtagCount: getSearchResults(
|
hashtagCount: getSearchResults(
|
||||||
context,
|
context,
|
||||||
@ -208,7 +220,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchGroups: (_parent, args, context, _resolveInfo) => {
|
searchGroups: (_parent, args, context, _resolveInfo) => {
|
||||||
const { query, groupsOffset, firstGroups } = args as { query: string; groupsOffset: number; firstGroups: number }
|
const { query, groupsOffset, firstGroups } = args as {
|
||||||
|
query: string
|
||||||
|
groupsOffset: number
|
||||||
|
firstGroups: number
|
||||||
|
}
|
||||||
let userId = null
|
let userId = null
|
||||||
if (context.user) userId = context.user.id
|
if (context.user) userId = context.user.id
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -157,7 +157,10 @@ export const createOrUpdateLocations = async (
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const queryLocations = async ({ place, lang }: { place: string; lang: string }, context: Context) => {
|
export const queryLocations = async (
|
||||||
|
{ place, lang }: { place: string; lang: string },
|
||||||
|
context: Context,
|
||||||
|
) => {
|
||||||
const res: any = await fetch(
|
const res: any = await fetch(
|
||||||
`https://api.mapbox.com/geocoding/v5/mapbox.places/${place}.json?access_token=${context.config.MAPBOX_TOKEN}&types=region,place,country&language=${lang}`,
|
`https://api.mapbox.com/geocoding/v5/mapbox.places/${place}.json?access_token=${context.config.MAPBOX_TOKEN}&types=region,place,country&language=${lang}`,
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user