Add a component to update a gear
This commit is contained in:
@@ -65,4 +65,33 @@ export class GearService extends BaseService {
|
||||
public getFromCache(): Observable<Array<GearResp>> {
|
||||
return this.serviceCacheApi.getByKey<Array<GearResp>>(CacheApiKey.Gear);
|
||||
}
|
||||
|
||||
public updateGear(
|
||||
id: number,
|
||||
name: string,
|
||||
manufacturer: string,
|
||||
minSize: number,
|
||||
maxSize: number,
|
||||
aad: string,
|
||||
mainCanopy: string,
|
||||
reserveCanopy: string,
|
||||
equipment: string,
|
||||
) {
|
||||
const gearData = {
|
||||
id: id,
|
||||
name: name,
|
||||
manufacturer: manufacturer,
|
||||
minSize: minSize,
|
||||
maxSize: maxSize,
|
||||
aad: aad,
|
||||
mainCanopy: mainCanopy,
|
||||
reserveCanopy: reserveCanopy,
|
||||
equipment: equipment,
|
||||
};
|
||||
const bodyUpdatedGear = new GearReq(gearData);
|
||||
|
||||
return this.http.put(`${this.apiUrl}/Gear/${id}`, bodyUpdatedGear, {
|
||||
headers: this.headers,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user