Only send the last_sync param if it's set
This commit is contained in:
parent
002c931d26
commit
3941133fcf
|
@ -103,9 +103,11 @@ public actor FervorClient: Sendable {
|
|||
}
|
||||
|
||||
public func syncItems(lastSync: Date?) async throws -> ItemsSyncUpdate {
|
||||
let request = URLRequest(url: buildURL(path: "/api/v1/items/sync", queryItems: [
|
||||
URLQueryItem(name: "last_sync", value: lastSync?.formatted(.iso8601))
|
||||
]))
|
||||
var query: [URLQueryItem] = []
|
||||
if let lastSync {
|
||||
query.append(URLQueryItem(name: "last_sync", value: lastSync.formatted(.iso8601)))
|
||||
}
|
||||
let request = URLRequest(url: buildURL(path: "/api/v1/items/sync", queryItems: query))
|
||||
return try await performRequest(request)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue