diff --git a/Back/skydiveLogs-api/Data/JumpsDb-log.db b/Back/skydiveLogs-api/Data/JumpsDb-log.db index f150d7e..5f4b694 100644 Binary files a/Back/skydiveLogs-api/Data/JumpsDb-log.db and b/Back/skydiveLogs-api/Data/JumpsDb-log.db differ diff --git a/Back/skydiveLogs-api/Data/JumpsDb.db b/Back/skydiveLogs-api/Data/JumpsDb.db index 1580d8f..4421e0d 100644 Binary files a/Back/skydiveLogs-api/Data/JumpsDb.db and b/Back/skydiveLogs-api/Data/JumpsDb.db differ diff --git a/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts b/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts index 55975b6..070ad4b 100644 --- a/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts +++ b/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts @@ -52,10 +52,18 @@ export class ListOfDzsComponent implements OnInit { public setToFavorite(dropzone: DropZoneResp) { dropzone.isFavorite = this.serviceApi.SetFavoriteDropZone(dropzone); + const data = this.dataSourceTable.data; + data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0)); + this.dataSourceTable = new MatTableDataSource(data); + this.dataSourceTable.paginator = this.paginator; } public removeToFavorite(dropzone: DropZoneResp) { - dropzone.isFavorite = this.serviceApi.RemoveFavoriteDropZone(dropzone); + dropzone.isFavorite = !this.serviceApi.RemoveFavoriteDropZone(dropzone); + const data = this.dataSourceTable.data; + data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0)); + this.dataSourceTable = new MatTableDataSource(data); + this.dataSourceTable.paginator = this.paginator; } openDialogToAdd() { diff --git a/Front/skydivelogs-app/src/app/new-jump/new-jump.component.ts b/Front/skydivelogs-app/src/app/new-jump/new-jump.component.ts index 64e4ba2..6a5dd1b 100644 --- a/Front/skydivelogs-app/src/app/new-jump/new-jump.component.ts +++ b/Front/skydivelogs-app/src/app/new-jump/new-jump.component.ts @@ -76,9 +76,13 @@ export class NewJumpComponent implements OnInit { public isValidatedForm(): boolean { return ( this.selectedDz !== undefined && + this.selectedDz.id !== undefined && this.selectedGear !== undefined && + this.selectedGear.id !== undefined && this.selectedAircraft !== undefined && + this.selectedAircraft.id !== undefined && this.selectedJumpType !== undefined && + this.selectedJumpType.id !== undefined && this.exitAltitude !== undefined && isNumber(this.exitAltitude) && this.deployAltitude !== undefined &&