♻️ Answer unknown API routes with JSON and fix stale comments
The SPA catch-all answered unknown /api paths with the index page and status 200, so the client SDK failed to parse the body. A catch-all per HTTP method answers them with a JSON 404 in the error shape of PocketBase; the routes registered before keep precedence. The comment on DataFields no longer claims the fields of the read-only collections were client writable.
This commit is contained in:
@@ -7,7 +7,11 @@ var Synced = []string{"entries", "closed_days", "closed_weeks", "settings_histor
|
||||
// ReadOnly collections are pulled by clients but only ever written by the server.
|
||||
var ReadOnly = []string{"closed_days", "closed_weeks"}
|
||||
|
||||
// DataFields lists, per synced collection, the record fields a client may write through the push endpoint.
|
||||
// DataFields lists, per synced collection, the record fields that hold the data
|
||||
// of a row, in contrast to the sync fields every collection shares (owner, rev,
|
||||
// client_updated_at and deleted). Only the fields of the writable collections
|
||||
// reach the records through the push endpoint; the read-only collections are
|
||||
// written by the server alone.
|
||||
var DataFields = map[string][]string{
|
||||
"entries": {"start_time", "end_time", "auto_stopped", "note", "day_key"},
|
||||
"closed_days": {"day_key", "worked_ms", "kind", "closed_at"},
|
||||
|
||||
Reference in New Issue
Block a user