Skip to content

Commit

Permalink
Mark badges as printed
Browse files Browse the repository at this point in the history
  • Loading branch information
hengkysanjaya123 committed Jan 9, 2024
1 parent a9d9cb9 commit 124118e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/print/print.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ export class PrintComponent extends WsComponent implements OnInit {
}

openBrowserPrintPreview(): void {
window.onbeforeprint = () => {
if (!this.adhocPrinting) {
this.people.map(p => p.id).forEach(personAcrId => {
this.personAcrService.markAsPrinted(this.selectedEvent.id, personAcrId).subscribe();
});
}
}
window.print();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export class PersonAccreditationService extends WsService<any> {
return this.http.put(`${this.url(eventId)}/${personAccreditationId}/distributed`, null).pipe(share());
}

markAsPrinted(eventId: number, personAccreditationId: number): Observable<any> {
return this.http.put(`${this.url(eventId)}/${personAccreditationId}/printed`, null).pipe(share());
}

initialiseFetchParams(): PersonAccreditationSummaryReqParams {
return {
name: null,
Expand Down

0 comments on commit 124118e

Please sign in to comment.