Add a component to update a gear

This commit is contained in:
2026-05-05 23:26:59 +02:00
parent 658c5dc362
commit 96f84cdc84
4 changed files with 202 additions and 0 deletions
@@ -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,
});
}
}