Rechnungsdialog: Zustand mit Reducer, Appwrite-Lesezugriffe und Hooks für Projektkonto, Vorschau und weitere Tickets
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0f1dbabd98
commit
6a5f943034
4 files changed
+418
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { databases, DATABASE_ID, COLLECTIONS, Query } from './appwrite'
|
||||
|
||||
/** Tickets eines Kunden, neueste zuerst (für „Weiteres Ticket hinzunehmen“). */
|
||||
export async function listKundenTickets(customerId) {
|
||||
const res = await databases.listDocuments(DATABASE_ID, COLLECTIONS.WORKORDERS, [
|
||||
Query.equal('customerId', customerId),
|
||||
Query.orderDesc('$createdAt'),
|
||||
Query.limit(100),
|
||||
])
|
||||
return res.documents
|
||||
}
|
||||
|
||||
/** Alle Arbeitsblätter eines Tickets (nach Ticketnummer `woid`). */
|
||||
export async function listTicketBlaetter(woid) {
|
||||
const res = await databases.listDocuments(DATABASE_ID, COLLECTIONS.WORKSHEETS, [
|
||||
Query.equal('woid', woid),
|
||||
Query.orderAsc('$createdAt'),
|
||||
Query.limit(5000),
|
||||
])
|
||||
return res.documents
|
||||
}
|
||||
Reference in new issue
Block a user