fix: exclude soft-deleted entries from overlap conflict check
This commit is contained in:
@@ -19,6 +19,7 @@ export async function hasOverlappingEntries(
|
|||||||
const count = await prisma.timeEntry.count({
|
const count = await prisma.timeEntry.count({
|
||||||
where: {
|
where: {
|
||||||
userId,
|
userId,
|
||||||
|
deletedAt: null,
|
||||||
...(excludeId ? { id: { not: excludeId } } : {}),
|
...(excludeId ? { id: { not: excludeId } } : {}),
|
||||||
// An entry overlaps when it starts before our end AND ends after our start.
|
// An entry overlaps when it starts before our end AND ends after our start.
|
||||||
startTime: { lt: endTime },
|
startTime: { lt: endTime },
|
||||||
|
|||||||
Reference in New Issue
Block a user