Fixes for new Ktor API

This commit is contained in:
William Brawner 2021-08-16 17:22:58 -06:00
parent eacc18e461
commit 270359d73b

View file

@ -122,22 +122,11 @@ export class TwigsHttpService implements TwigsService {
id: string, id: string,
name: string, name: string,
description: string, description: string,
users: UserPermission[],
): Observable<Budget> { ): Observable<Budget> {
const params = { const params = {
'id': id, 'id': id,
'name': name, 'name': name,
'description': description, 'description': description,
<<<<<<< HEAD
'users': users.map(userPermission => {
return {
user: userPermission.user,
permission: Permission[userPermission.permission]
};
})
=======
'users': users
>>>>>>> 4488aff (Finish implementing /api/budget routes)
}; };
return this.http.post<Budget>(this.apiUrl + '/budgets', params, this.options) return this.http.post<Budget>(this.apiUrl + '/budgets', params, this.options)
.pipe(map(budget => { .pipe(map(budget => {
@ -154,12 +143,6 @@ export class TwigsHttpService implements TwigsService {
const params = { const params = {
'name': budget.name, 'name': budget.name,
'description': budget.description, 'description': budget.description,
'users': budget.users.map(userPermission => {
return {
user: userPermission.user,
permission: Permission[userPermission.permission]
};
})
}; };
return this.http.put<Budget>(`${this.apiUrl}/budgets/${id}`, params, this.options) return this.http.put<Budget>(`${this.apiUrl}/budgets/${id}`, params, this.options)
.pipe(map(budget => { .pipe(map(budget => {