Add basic support for organizations (#80)

This commit is contained in:
Simon Lecoq
2021-01-25 23:47:24 +01:00
committed by GitHub
parent d4d873bb39
commit 1c8dcbc8aa
21 changed files with 178 additions and 59 deletions

View File

@@ -1,10 +1,12 @@
//Setup
export default async function ({login, graphql, q, queries}, {enabled = false} = {}) {
export default async function ({login, graphql, q, queries, account}, {enabled = false} = {}) {
//Plugin execution
try {
//Check if plugin is enabled and requirements are met
if ((!enabled)||(!q.gists))
return null
if (account === "organization")
throw {error:{message:"Not available for organizations"}}
//Query gists from GitHub API
const gists = []
{
@@ -39,6 +41,8 @@
}
//Handle errors
catch (error) {
if (error.error?.message)
throw error
throw {error:{message:"An error occured", instance:error}}
}
}