Skip to content

Commit e286499

Browse files
Copilotrenemadsen
andcommitted
Fix build error: replace selectCurrentUserId with selectAuthUser
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
1 parent 0790f7e commit e286499

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

eform-client/src/app/plugins/modules/time-planning-pn/modules/absence-requests/components/absence-requests-actions/absence-requests-approve-modal/absence-requests-approve-modal.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AbsenceRequestModel, AbsenceRequestDecisionModel } from 'src/app/plugin
55
import { ToastrService } from 'ngx-toastr';
66
import { TranslateService } from '@ngx-translate/core';
77
import { Store } from '@ngrx/store';
8-
import { selectCurrentUserId } from 'src/app/state';
8+
import { selectAuthUser } from 'src/app/state';
99
import { take } from 'rxjs';
1010

1111
@Component({
@@ -30,8 +30,8 @@ export class AbsenceRequestsApproveModalComponent implements OnInit {
3030
ngOnInit() {
3131
this.selectedAbsenceRequest = { ...this.model.selectedAbsenceRequest };
3232
// Get current user ID (take only once)
33-
this.store.select(selectCurrentUserId).pipe(take(1)).subscribe((userId) => {
34-
this.currentUserId = userId;
33+
this.store.select(selectAuthUser).pipe(take(1)).subscribe((user) => {
34+
this.currentUserId = user?.id || null;
3535
});
3636
}
3737

eform-client/src/app/plugins/modules/time-planning-pn/modules/absence-requests/components/absence-requests-actions/absence-requests-reject-modal/absence-requests-reject-modal.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AbsenceRequestModel, AbsenceRequestDecisionModel } from 'src/app/plugin
55
import { ToastrService } from 'ngx-toastr';
66
import { TranslateService } from '@ngx-translate/core';
77
import { Store } from '@ngrx/store';
8-
import { selectCurrentUserId } from 'src/app/state';
8+
import { selectAuthUser } from 'src/app/state';
99
import { take } from 'rxjs';
1010

1111
@Component({
@@ -30,8 +30,8 @@ export class AbsenceRequestsRejectModalComponent implements OnInit {
3030
ngOnInit() {
3131
this.selectedAbsenceRequest = { ...this.model.selectedAbsenceRequest };
3232
// Get current user ID (take only once)
33-
this.store.select(selectCurrentUserId).pipe(take(1)).subscribe((userId) => {
34-
this.currentUserId = userId;
33+
this.store.select(selectAuthUser).pipe(take(1)).subscribe((user) => {
34+
this.currentUserId = user?.id || null;
3535
});
3636
}
3737

eform-client/src/app/plugins/modules/time-planning-pn/modules/absence-requests/components/absence-requests-container/absence-requests-container.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { AutoUnsubscribe } from 'ngx-auto-unsubscribe';
88
import { ToastrService } from 'ngx-toastr';
99
import { TranslateService } from '@ngx-translate/core';
1010
import { Store } from '@ngrx/store';
11-
import { selectCurrentUserId } from 'src/app/state';
11+
import { selectAuthUser } from 'src/app/state';
1212

1313
@AutoUnsubscribe()
1414
@Component({
@@ -31,9 +31,9 @@ export class AbsenceRequestsContainerComponent implements OnInit, OnDestroy {
3131
selectCurrentUserIdSub$: Subscription;
3232

3333
ngOnInit(): void {
34-
// Subscribe to current user ID
35-
this.selectCurrentUserIdSub$ = this.store.select(selectCurrentUserId).subscribe((userId) => {
36-
this.currentUserId = userId;
34+
// Subscribe to current user to get user ID
35+
this.selectCurrentUserIdSub$ = this.store.select(selectAuthUser).subscribe((user) => {
36+
this.currentUserId = user?.id || null;
3737
if (this.currentUserId) {
3838
this.loadAbsenceRequests();
3939
}

0 commit comments

Comments
 (0)