Skip to content

Commit

Permalink
[000] fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
pro100Koss authored and Manuel Hummler committed Jan 2, 2025
1 parent 4c0697b commit 3d60476
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions frontend/spa/src/components/InvoicesTable/InvoicesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const InvoicesTable = ({ invoices }: Props) => {
filterParams: { items: getBommelFilterItems() },
flex: 1,
},
{ headerName: 'Creditor', field: 'creditor', filter: 'agTextColumnFilter', flex: 2 },
{ headerName: 'Submitter', field: 'submitter', filter: 'agTextColumnFilter', flex: 2 },
// { headerName: 'Creditor', field: 'creditor', filter: 'agTextColumnFilter', flex: 2 },
// { headerName: 'Submitter', field: 'submitter', filter: 'agTextColumnFilter', flex: 2 },
{
headerName: 'Amount',
field: 'amount',
Expand Down
13 changes: 4 additions & 9 deletions frontend/spa/src/services/auth/AuthService.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { pick } from 'lodash';

import { KeycloakServiceProvider } from '@/services/auth/keycloakServiceProvider.ts';
import { AuthServiceProvider } from '@/services/auth/AuthServiceProvider.ts';
import { useStore } from '@/store/store.ts';
Expand Down Expand Up @@ -64,15 +66,8 @@ export class AuthService {
return localStorage.getItem('AUTH_TOKEN_REFRESH') || undefined;
}

async setAuthUser(userData: { name: string; email: string } | null) {
useStore.getState().setUser(
userData !== null
? {
name: userData.name,
email: userData.email,
}
: null
);
async setAuthUser(userData: { id: string; name: string; email: string } | null) {
useStore.getState().setUser(userData !== null ? pick(userData, ['id', 'name', 'email']) : null);
await this.loadUserOrganisation();
useStore.getState().setIsAuthenticated(!!userData);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('AuthService', () => {
});

it('should set auth user', async () => {
const userData = { name: 'John Doe', email: '[email protected]' };
const userData = { id: 'id', name: 'John Doe', email: '[email protected]' };
vi.spyOn(authService, 'loadUserOrganisation').mockResolvedValue(undefined);
await authService.setAuthUser(userData);

Expand Down
2 changes: 1 addition & 1 deletion frontend/spa/src/services/auth/keycloakServiceProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class KeycloakServiceProvider implements AuthServiceProvider {
this.authService.setAuthTokens(this.keycloak.token, this.keycloak.refreshToken);

try {
const data = (await this.keycloak.loadUserInfo()) as { name: string; email: string };
const data = (await this.keycloak.loadUserInfo()) as { id: string; name: string; email: string };
await this.authService.setAuthUser(data);
} catch (e) {
await this.authService.setAuthUser(null);
Expand Down

0 comments on commit 3d60476

Please sign in to comment.