fix: fixed deal dragging end

This commit is contained in:
2025-08-04 11:20:22 +04:00
parent 2ae9c619c7
commit f13417e73a

View File

@ -108,7 +108,8 @@ const useDnd = (props: Props) => {
const getDropTarget = (
overId: string | number,
activeDealId: number,
activeStatusId: number
activeStatusId: number,
isOnDragEnd: boolean = false
) => {
if (typeof overId === "string") {
return {
@ -120,7 +121,7 @@ const useDnd = (props: Props) => {
const overDealId = Number(overId);
const overStatusId = getStatusByDealId(overDealId)?.id;
if (!overStatusId || activeDealId === overDealId) {
if (!overStatusId || (!isOnDragEnd && activeDealId === overDealId)) {
return { overStatusId: undefined, newLexorank: undefined };
}
@ -190,7 +191,8 @@ const useDnd = (props: Props) => {
const { overStatusId, newLexorank } = getDropTarget(
over.id,
activeDealId,
activeStatusId
activeStatusId,
true
);
if (!overStatusId) return;