Skip to content

Commit cbfcb10

Browse files
authored
Merge pull request #551 from HiEventsDev/develop
Fix: Include attendees from offline payment order in exports (#550)
2 parents 806b2f9 + e24e45d commit cbfcb10

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

backend/app/Repository/Eloquent/AttendeeRepository.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ public function findByEventIdForExport(int $eventId): Collection
3737

3838
$this->model->select('attendees.*');
3939
$this->model->join('orders', 'orders.id', '=', 'attendees.order_id');
40-
$this->model->whereIn('orders.status', [OrderStatus::COMPLETED->name, OrderStatus::CANCELLED->name]);
40+
$this->model->whereIn('orders.status', [
41+
OrderStatus::AWAITING_OFFLINE_PAYMENT->name,
42+
OrderStatus::COMPLETED->name,
43+
OrderStatus::CANCELLED->name
44+
]);
4145

4246
$model = $this->model->limit(10000)->get();
4347
$this->resetModel();

frontend/src/mutations/useExportAnswers.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export const useExportAnswers = (eventId: IdParam) => {
2222
const query = useQuery({
2323
queryKey: ["exportStatus", jobUuid],
2424
queryFn: async () => {
25-
if (!jobUuid) return null;
25+
if (!jobUuid) {
26+
return null;
27+
}
2628

2729
try {
2830
const data = await questionClient.checkExportStatus(eventId, jobUuid);
@@ -46,10 +48,13 @@ export const useExportAnswers = (eventId: IdParam) => {
4648
}
4749
},
4850
enabled: !!jobUuid,
49-
refetchInterval: (data) => (data?.status === "IN_PROGRESS"
50-
? 5000
51-
: false
52-
),
51+
refetchInterval: (data) => {
52+
const status = data?.state?.data?.status;
53+
return (status === "IN_PROGRESS"
54+
? 5000
55+
: false
56+
);
57+
},
5358
});
5459

5560
return {

0 commit comments

Comments
 (0)