Skip to content

Commit

Permalink
Merge pull request #288 from virtualidentityag/fix/OB-5079-erstberatung
Browse files Browse the repository at this point in the history
fix: prevent deleting default event OB-5079
  • Loading branch information
CarlosSoares authored May 31, 2023
2 parents cd90ba5 + 8732293 commit 682dafd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pages/Agency/EditInitialMeeting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const AgencyEditInitialMeeting = () => {
duration: event.length,
advisor: null,
locations: event.locations,
isDefaultEvent: JSON.parse(event.metadata || '{}')?.defaultEventType,
});
});
return agencyEventTypes;
Expand Down Expand Up @@ -119,7 +120,7 @@ export const AgencyEditInitialMeeting = () => {
setEventTypeDelete(data);
};

function defineTableColumns(): ColumnsType<AgencyEditData> {
function defineTableColumns(): ColumnsType<AgencyEventTypes> {
return [
{
title: t('agency.edit.initialMeeting.table.appointment_label'),
Expand Down Expand Up @@ -149,15 +150,15 @@ export const AgencyEditInitialMeeting = () => {
width: 88,
title: '',
key: 'edit',
render: (_: any, record: AgencyEditData) => {
render: (_: any, record: AgencyEventTypes) => {
return (
<div className="tableActionWrapper">
<EditButtons
isDisabled={record.status === 'IN_DELETION'}
handleEdit={handleEditTable}
handleDelete={handleDeleteTable}
record={record}
resource={Resource.Agency}
disabled={{ edit: false, delete: record.isDefaultEvent }}
/>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions src/types/agencyEdit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export interface AgencyEventTypes {
type?: any;
consultantIds?: any;
consultants?: ConsultantInterface[];
isDefaultEvent?: boolean;
}

export interface AgencyEventTypeUpdate {
Expand Down

0 comments on commit 682dafd

Please sign in to comment.