Skip to content

Commit

Permalink
adding delete-endpoint to surveys
Browse files Browse the repository at this point in the history
  • Loading branch information
Angamanga committed May 12, 2020
1 parent c1470ab commit 86c5de4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ushahidi-platform-sdk",
"version": "0.1.5",
"version": "0.1.6",
"description": "An SDK for the Ushahidi Platform - V3+ compatible",
"engines": {
"node": ">= 10 <13"
Expand Down
11 changes: 11 additions & 0 deletions src/surveys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,15 @@ export class Surveys {
});
return res;
}

async deleteSurvey(id:string):Promise<unknown> {
const res = await axios({
method: 'delete',
url: `${this.backendUrl}/api/v4/surveys/${id}`,
headers:{
"Authorization": `Bearer ${this.token}`
}
});
return res;
}
}

0 comments on commit 86c5de4

Please sign in to comment.