new query to validate if a hub has orders before delete

This commit is contained in:
José Salazar
2026-01-29 18:01:16 -05:00
parent a9093bf7eb
commit 34546f9b2a
5 changed files with 18368 additions and 17969 deletions

View File

@@ -392,3 +392,43 @@ query getRapidOrders(
}
}
#to validate if an hub has orders before delete
query listOrdersByBusinessAndTeamHub(
$businessId: UUID!
$teamHubId: UUID!
$offset: Int
$limit: Int
) @auth(level: USER) {
orders(
where: {
businessId: { eq: $businessId }
teamHubId: { eq: $teamHubId }
}
offset: $offset
limit: $limit
orderBy: { createdAt: DESC }
) {
id
eventName
orderType
status
duration
businessId
vendorId
teamHubId
date
startDate
endDate
requested
total
notes
createdAt
updatedAt
createdBy
}
}