add post method v1

This commit is contained in:
Zuhdan Ubay 2020-05-19 23:42:01 +07:00
parent 02368778a4
commit 068f8dda2f

View file

@ -21,12 +21,11 @@ export class PromotionService {
}
postPromotion(data: PromotionList): Observable<any> {
console.log(JSON.stringify(data));
let headers = new HttpHeaders({
const headers = new HttpHeaders({
'Content-Type': 'application/json',
'X-Requested-Method': 'POST',
});
let options = { headers: headers };
const options = { headers: headers };
const url = 'http://localhost:8011/api/promotions/add';
return this.http.post(url, JSON.stringify(data), options).pipe(
catchError(this.handleError),