feat: show real actor
This commit is contained in:
parent
5ee4deda98
commit
f01e3d4ca9
2 changed files with 17 additions and 3 deletions
|
|
@ -13,6 +13,7 @@ import {
|
|||
// NOTE: Import stores
|
||||
import { useQuotationStore } from 'stores/quotations';
|
||||
import useEmployeeStore from 'stores/employee';
|
||||
import { getName } from 'src/services/keycloak';
|
||||
|
||||
const DEFAULT_DATA: QuotationPayload = {
|
||||
productServiceList: [],
|
||||
|
|
@ -68,8 +69,10 @@ export const useQuotationForm = defineStore('form-quotation', () => {
|
|||
);
|
||||
const currentFormState = ref<{
|
||||
mode: null | 'info' | 'create' | 'edit';
|
||||
createdBy: (locale: string) => string;
|
||||
}>({
|
||||
mode: null,
|
||||
createdBy: (_) => getName() || '',
|
||||
});
|
||||
|
||||
function isFormDataDifferent() {
|
||||
|
|
@ -115,6 +118,10 @@ export const useQuotationForm = defineStore('form-quotation', () => {
|
|||
|
||||
currentFormData.value = structuredClone(resetFormData);
|
||||
|
||||
currentFormState.value.createdBy = (locale) =>
|
||||
locale === 'eng'
|
||||
? data.createdBy.firstNameEN + ' ' + data.createdBy.lastNameEN
|
||||
: data.createdBy.firstName + ' ' + data.createdBy.lastName;
|
||||
currentFormState.value.mode = mode;
|
||||
}
|
||||
|
||||
|
|
@ -149,6 +156,7 @@ export const useQuotationForm = defineStore('form-quotation', () => {
|
|||
}
|
||||
|
||||
currentFormState.value.mode = 'info';
|
||||
currentFormState.value.createdBy = (_) => getName() || '';
|
||||
}
|
||||
|
||||
function injectNewEmployee(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue