This commit is contained in:
2026-02-18 21:48:55 +01:00
parent 7659b01614
commit b66b433c08

View File

@@ -63,7 +63,7 @@ final class SyncManager: ObservableObject {
switch item.action { switch item.action {
case "create": case "create":
let input = try decoder.decode(CreateTimeEntryInput.self, from: data) let input = try decoder.decode(CreateTimeEntryInput.self, from: data)
_ = try await apiClient.request( try await apiClient.requestVoid(
endpoint: APIEndpoint.timeEntries, endpoint: APIEndpoint.timeEntries,
method: .post, method: .post,
body: input, body: input,
@@ -75,14 +75,14 @@ final class SyncManager: ObservableObject {
let input: UpdateTimeEntryInput let input: UpdateTimeEntryInput
} }
let request = try decoder.decode(UpdateRequest.self, from: data) let request = try decoder.decode(UpdateRequest.self, from: data)
_ = try await apiClient.request( try await apiClient.requestVoid(
endpoint: APIEndpoint.timeEntry(id: request.id), endpoint: APIEndpoint.timeEntry(id: request.id),
method: .put, method: .put,
body: request.input, body: request.input,
authenticated: true authenticated: true
) )
case "delete": case "delete":
_ = try await apiClient.requestVoid( try await apiClient.requestVoid(
endpoint: APIEndpoint.timeEntry(id: item.id), endpoint: APIEndpoint.timeEntry(id: item.id),
method: .delete, method: .delete,
authenticated: true authenticated: true
@@ -96,7 +96,7 @@ final class SyncManager: ObservableObject {
switch item.action { switch item.action {
case "create": case "create":
let input = try decoder.decode(CreateClientInput.self, from: data) let input = try decoder.decode(CreateClientInput.self, from: data)
_ = try await apiClient.request( try await apiClient.requestVoid(
endpoint: APIEndpoint.clients, endpoint: APIEndpoint.clients,
method: .post, method: .post,
body: input, body: input,
@@ -108,14 +108,14 @@ final class SyncManager: ObservableObject {
let input: UpdateClientInput let input: UpdateClientInput
} }
let request = try decoder.decode(UpdateRequest.self, from: data) let request = try decoder.decode(UpdateRequest.self, from: data)
_ = try await apiClient.request( try await apiClient.requestVoid(
endpoint: APIEndpoint.client(id: request.id), endpoint: APIEndpoint.client(id: request.id),
method: .put, method: .put,
body: request.input, body: request.input,
authenticated: true authenticated: true
) )
case "delete": case "delete":
_ = try await apiClient.requestVoid( try await apiClient.requestVoid(
endpoint: APIEndpoint.client(id: item.id), endpoint: APIEndpoint.client(id: item.id),
method: .delete, method: .delete,
authenticated: true authenticated: true
@@ -129,7 +129,7 @@ final class SyncManager: ObservableObject {
switch item.action { switch item.action {
case "create": case "create":
let input = try decoder.decode(CreateProjectInput.self, from: data) let input = try decoder.decode(CreateProjectInput.self, from: data)
_ = try await apiClient.request( try await apiClient.requestVoid(
endpoint: APIEndpoint.projects, endpoint: APIEndpoint.projects,
method: .post, method: .post,
body: input, body: input,
@@ -141,14 +141,14 @@ final class SyncManager: ObservableObject {
let input: UpdateProjectInput let input: UpdateProjectInput
} }
let request = try decoder.decode(UpdateRequest.self, from: data) let request = try decoder.decode(UpdateRequest.self, from: data)
_ = try await apiClient.request( try await apiClient.requestVoid(
endpoint: APIEndpoint.project(id: request.id), endpoint: APIEndpoint.project(id: request.id),
method: .put, method: .put,
body: request.input, body: request.input,
authenticated: true authenticated: true
) )
case "delete": case "delete":
_ = try await apiClient.requestVoid( try await apiClient.requestVoid(
endpoint: APIEndpoint.project(id: item.id), endpoint: APIEndpoint.project(id: item.id),
method: .delete, method: .delete,
authenticated: true authenticated: true