Implement shelf sorting

This commit is contained in:
aditya.chandel
2024-12-25 22:07:13 -07:00
parent 7345f3f0ee
commit b7531670bf
3 changed files with 15 additions and 1 deletions
@@ -38,7 +38,7 @@ export class ShelfService {
}
updateSort(shelfId: number, sort: SortOption): Observable<Shelf> {
return this.http.put<Shelf>(`${this.url}/${shelfId}/sort`, { shelfId, sort }).pipe(
return this.http.put<Shelf>(`${this.url}/${shelfId}/sort`, sort).pipe(
map(updatedShelf => {
const updatedShelves = this.shelves.value.map(shelf =>
shelf.id === shelfId ? updatedShelf : shelf