Fix sur les ajouts d'infos
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Injectable } from "@angular/core";
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { Observable } from "rxjs";
|
||||
import { map } from "rxjs/operators";
|
||||
|
||||
import { DropZoneResp } from '../models/dropzone';
|
||||
|
||||
import { BaseService } from './base.service';
|
||||
import { DropZoneResp, DropZoneReq } from "../models/dropzone";
|
||||
|
||||
import { BaseService } from "./base.service";
|
||||
|
||||
@Injectable()
|
||||
export class DropzoneService extends BaseService {
|
||||
@@ -48,4 +47,33 @@ export class DropzoneService extends BaseService {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public AddDropZone(
|
||||
latitude: string,
|
||||
longitude: string,
|
||||
name: string,
|
||||
address: string,
|
||||
website: string,
|
||||
email: string,
|
||||
type: Array<string>,
|
||||
isFavorite: boolean
|
||||
) {
|
||||
const bodyNewDropZone: DropZoneReq = {
|
||||
id: 0,
|
||||
latitude: latitude,
|
||||
longitude: longitude,
|
||||
name: name,
|
||||
address: address,
|
||||
website: website,
|
||||
email: email,
|
||||
type: type,
|
||||
isFavorite: isFavorite
|
||||
};
|
||||
|
||||
this.http
|
||||
.post(`${this.apiUrl}/DropZone`, bodyNewDropZone, {
|
||||
headers: this.headers
|
||||
})
|
||||
.subscribe(data => console.log(data));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user