chore: code formatting
This commit is contained in:
@@ -10,22 +10,22 @@ export default async function({login, q, imports, data, graphql, queries, accoun
|
||||
let {title} = imports.metadata.plugins.introduction.inputs({data, account, q})
|
||||
|
||||
//Context
|
||||
let context = {mode:account, login}
|
||||
let context = {mode: account, login}
|
||||
if (q.repo) {
|
||||
console.debug(`metrics/compute/${login}/plugins > people > switched to repository mode`)
|
||||
const {owner, repo} = data.user.repositories.nodes.map(({name:repo, owner:{login:owner}}) => ({repo, owner})).shift()
|
||||
context = {...context, mode:"repository", owner, repo}
|
||||
const {owner, repo} = data.user.repositories.nodes.map(({name: repo, owner: {login: owner}}) => ({repo, owner})).shift()
|
||||
context = {...context, mode: "repository", owner, repo}
|
||||
}
|
||||
|
||||
//Querying API
|
||||
console.debug(`metrics/compute/${login}/plugins > introduction > querying api`)
|
||||
const text = (await graphql(queries.introduction[context.mode](context)))[context.mode][{user:"bio", organization:"description", repository:"description"}[context.mode]]
|
||||
const text = (await graphql(queries.introduction[context.mode](context)))[context.mode][{user: "bio", organization: "description", repository: "description"}[context.mode]]
|
||||
|
||||
//Results
|
||||
return {mode:context.mode, title, text}
|
||||
return {mode: context.mode, title, text}
|
||||
}
|
||||
//Handle errors
|
||||
catch (error) {
|
||||
throw {error:{message:"An error occured", instance:error}}
|
||||
throw {error: {message: "An error occured", instance: error}}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user