test update some permissions
This commit is contained in:
parent
ac64335d5b
commit
25ce65e425
15 changed files with 582 additions and 493 deletions
|
|
@ -2,7 +2,7 @@ import { CommonModule, DatePipe } from '@angular/common';
|
|||
import { Component, EventEmitter, OnInit } from '@angular/core';
|
||||
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||
import { Observable, first } from 'rxjs';
|
||||
import {Observable, first, map} from 'rxjs';
|
||||
import { RecipeService } from 'src/app/core/services/recipe.service';
|
||||
import { ConfirmModal } from 'src/app/shared/modal/confirm/confirm-modal.component';
|
||||
import { animate, style, transition, trigger } from '@angular/animations';
|
||||
|
|
@ -11,8 +11,7 @@ import {
|
|||
RecipeDetail,
|
||||
RecipeDetailMat,
|
||||
} from 'src/app/core/models/recipe.model';
|
||||
import { Action, ActionRecord } from 'src/app/shared/actionRecord/actionRecord';
|
||||
import { isEqual } from 'lodash';
|
||||
import { ActionRecord } from 'src/app/shared/actionRecord/actionRecord';
|
||||
import { UserService } from 'src/app/core/services/user.service';
|
||||
|
||||
@Component({
|
||||
|
|
@ -119,10 +118,9 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
|
||||
// get username
|
||||
let username:string = ""
|
||||
this._userService.getCurrentUser().subscribe((user) => {
|
||||
username = user.user.name;
|
||||
|
||||
|
||||
this._userService.currentUser.pipe(map((user) => {
|
||||
if (user)
|
||||
username = user.name;
|
||||
|
||||
let to_send = {
|
||||
edit_by: username,
|
||||
|
|
@ -152,8 +150,8 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
}
|
||||
);
|
||||
console.log('Sending changes');
|
||||
this._router.navigate(['/recipes']);
|
||||
})
|
||||
void this._router.navigate(['/recipes']);
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
|
@ -198,6 +196,6 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
onRecipeListFormChange(repl: unknown[]) {
|
||||
console.log('Recipe List Form Changed', repl);
|
||||
this.repl = repl as never[];
|
||||
this.isValueChanged ||= repl != undefined ? true : false;
|
||||
this.isValueChanged ||= repl != undefined;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue