Add basic support for organizations (#80)
This commit is contained in:
@@ -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}}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user