feat: small refactor, address now is telegram
This commit is contained in:
@@ -109,9 +109,9 @@ const Content: FC<Props> = ({deal}) => {
|
||||
{...form.getInputProps('client.details.email')}
|
||||
/>
|
||||
<TextInput
|
||||
placeholder={"Введите адрес"}
|
||||
label={"Адрес"}
|
||||
{...form.getInputProps('client.details.address')}
|
||||
placeholder={"Введите телеграм"}
|
||||
label={"Телеграм"}
|
||||
{...form.getInputProps('client.details.telegram')}
|
||||
/>
|
||||
<TextInput
|
||||
placeholder={"Введите ИНН"}
|
||||
|
||||
@@ -47,20 +47,36 @@ export const LeadsPage: FC = () => {
|
||||
}
|
||||
const onDragEnd = async (result: DropResult) => {
|
||||
setIsDragEnded(true);
|
||||
// If there is no changes
|
||||
if (!result.destination || result.destination == result.source) return;
|
||||
|
||||
// Checking for valid dealId
|
||||
const dealId = parseInt(result.draggableId);
|
||||
if (isNaN(dealId)) return;
|
||||
|
||||
// Checking for valid deal
|
||||
const summary = summaries.find(summary => summary.id == dealId);
|
||||
if (!summary) return;
|
||||
|
||||
// Checking if it is custom actions
|
||||
const droppableId = result.destination.droppableId;
|
||||
if (droppableId === 'DELETE') {
|
||||
onDelete(dealId);
|
||||
return;
|
||||
}
|
||||
|
||||
const status = getDealStatusByName(droppableId);
|
||||
const request: Partial<DealSummaryReorderRequest> = {
|
||||
dealId: dealId,
|
||||
index: result.destination.index,
|
||||
status: getDealStatusByName(droppableId)
|
||||
status: status
|
||||
}
|
||||
if (status == summary.status) {
|
||||
DealService.reorderDealSummaries({requestBody: request as DealSummaryReorderRequest})
|
||||
.then(async response => {
|
||||
setSummaries(response.summaries);
|
||||
await refetch();
|
||||
});
|
||||
return;
|
||||
}
|
||||
modals.openContextModal({
|
||||
modal: 'enterDeadline',
|
||||
|
||||
Reference in New Issue
Block a user