Skip to content
Permalink
Browse files

feat(api): HZN-1357 Pass data and set accept header

  • Loading branch information...
smith-opennms committed Aug 22, 2018
1 parent 3d9f172 commit 0bf0bdd200eef46d7b11fbccaa529c2018408d0a
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/dao/SituationFeedbackDAO.ts
@@ -57,9 +57,7 @@ export class SituationFeedbackDAO extends BaseDAO {
* @param {OnmsSituationFeedback[]} feedback - The [[OnmsSituationFeedback]].
*/
public async saveFeedback(feedback: OnmsSituationFeedback[], situationId: number): Promise<void> {
const parameters = {} as IHash<string>;
parameters.body = JSON.stringify(feedback);
return this.post(this.pathToEndpoint() + '/' + situationId, parameters);
return this.post(this.pathToEndpoint() + '/' + situationId, feedback);
}

/**
@@ -99,9 +97,11 @@ export class SituationFeedbackDAO extends BaseDAO {
* Call a POST request in the format the SituationFeedback API expects.
* @hidden
*/
private async post(url: string, parameters = {} as IHash<string>): Promise<void> {
private async post(url: string, data: any): Promise<void> {
const options = new OnmsHTTPOptions();
options.headers['content-type'] = 'application/json';
options.headers.accept = 'application/json';
options.data = data;
return this.http.post(url, options).then((result) => {
if (!result.isSuccess) {
throw result;

0 comments on commit 0bf0bdd

Please sign in to comment.
You can’t perform that action at this time.