Skip to content

Commit

Permalink
Delete
Browse files Browse the repository at this point in the history
  • Loading branch information
melohagan committed Oct 19, 2022
1 parent 351b743 commit 50a1c45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
15 changes: 3 additions & 12 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,18 @@
}
}
},
"update": {
"delete": {
"type": "fields",
"fields": {
"databaseId": {
"type": "string",
"required": true
},
"name": {
"type": "string",
"required": true
}
}
},
"delete": {
"type": "fields",
"fields": {
"databaseId": {
"collectionId": {
"type": "string",
"required": true
},
"collectionId": {
"key": {
"type": "string",
"required": true
}
Expand Down
11 changes: 5 additions & 6 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@ class CustomIntegration implements IntegrationBase {
return await this.databases.listAttributes(query.databaseId, query.collectionId)
}

async update(query: { databaseId: string; collectionId: string; }) {

}

async delete(query: { databaseId: string; collectionId: string; extra: { [key:string]: string; } }) {

async delete(query: { databaseId: string; collectionId: string; key: string; extra: { [key:string]: string; } }) {
if (query.extra.type === "Index") {
return await this.databases.deleteIndex(query.databaseId, query.collectionId, query.key)
}
return await this.databases.deleteAttribute(query.databaseId, query.collectionId, query.key)
}
}

Expand Down

0 comments on commit 50a1c45

Please sign in to comment.