Ajout d'un champs "Commentaires" lors de l'ajoute de sauts
This commit is contained in:
@@ -40,10 +40,7 @@ export class AuthenticationService extends BaseService {
|
||||
})
|
||||
.pipe(
|
||||
map(user => {
|
||||
// store user details and basic auth credentials in local storage to keep user logged in between page refreshes
|
||||
user.authdata = window.btoa(username + ":" + password);
|
||||
localStorage.setItem("currentUser", JSON.stringify(user));
|
||||
this.currentUserSubject.next(user);
|
||||
this.pushUserToken(username, password, user);
|
||||
return user;
|
||||
})
|
||||
);
|
||||
@@ -56,15 +53,19 @@ export class AuthenticationService extends BaseService {
|
||||
})
|
||||
.pipe(
|
||||
map(user => {
|
||||
// store user details and basic auth credentials in local storage to keep user logged in between page refreshes
|
||||
user.authdata = window.btoa(newUser.login + ":" + newUser.password);
|
||||
localStorage.setItem("currentUser", JSON.stringify(user));
|
||||
this.currentUserSubject.next(user);
|
||||
this.pushUserToken(newUser.login, newUser.password, user);
|
||||
return user;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private pushUserToken(login: string, password: string, user: any){
|
||||
// store user details and basic auth credentials in local storage to keep user logged in between page refreshes
|
||||
user.authdata = window.btoa(login + ":" + password);
|
||||
localStorage.setItem("currentUser", JSON.stringify(user));
|
||||
this.currentUserSubject.next(user);
|
||||
}
|
||||
|
||||
private alwaysLogin() {
|
||||
return this.http.get(`${this.apiUrl}/User/AlwayLogin`, {
|
||||
headers: this.headers
|
||||
|
||||
@@ -37,10 +37,9 @@ export class JumpService extends BaseService {
|
||||
endDate: Date,
|
||||
defaultExitAltitude: number,
|
||||
defaultDeployAltitude: number,
|
||||
countOfJumps: number
|
||||
) {
|
||||
const diffInDays =
|
||||
this.dateService.DiffBetweenDates(beginDate, endDate) + 1;
|
||||
countOfJumps: number,
|
||||
notes: string) {
|
||||
const diffInDays = this.dateService.DiffBetweenDates(beginDate, endDate) + 1;
|
||||
const countOfJumpsPerDay = Math.trunc(countOfJumps / diffInDays);
|
||||
|
||||
for (let i = 1; beginDate.getTime() < endDate.getTime(); i++) {
|
||||
@@ -53,7 +52,8 @@ export class JumpService extends BaseService {
|
||||
beginDate,
|
||||
defaultExitAltitude,
|
||||
defaultDeployAltitude,
|
||||
countOfJumpsPerDay
|
||||
countOfJumpsPerDay,
|
||||
notes
|
||||
);
|
||||
|
||||
beginDate = this.dateService.AddDays(beginDate, 1);
|
||||
@@ -70,7 +70,8 @@ export class JumpService extends BaseService {
|
||||
beginDate,
|
||||
defaultExitAltitude,
|
||||
defaultDeployAltitude,
|
||||
restfJumps
|
||||
restfJumps,
|
||||
notes
|
||||
);
|
||||
}
|
||||
|
||||
@@ -83,7 +84,8 @@ export class JumpService extends BaseService {
|
||||
jumpDate: Date,
|
||||
defaultExitAltitude: number,
|
||||
defaultDeployAltitude: number,
|
||||
countOfJumps: number
|
||||
countOfJumps: number,
|
||||
notes: string
|
||||
) {
|
||||
for (let i = 0; i < countOfJumps; i++) {
|
||||
const bodyNewjump: JumpReq = {
|
||||
@@ -94,7 +96,7 @@ export class JumpService extends BaseService {
|
||||
exitAltitude: defaultExitAltitude,
|
||||
deployAltitude: defaultDeployAltitude,
|
||||
gearId: selectedRig,
|
||||
notes: "",
|
||||
notes: notes,
|
||||
id: 0,
|
||||
jumpDate: jumpDate,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user