mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-10 07:31:27 -07:00
[playersettings] fix delete setting
This commit is contained in:
@@ -10,11 +10,18 @@ Player-settings worker served on the `playersettings` subdomain.
|
||||
`key=…&value=…` (or a JSON `{key,value}` / array) and **upserts** it into the
|
||||
player's settings, keyed by the `sub` claim of the Bearer JWT. Returns `200`.
|
||||
Persisted in Workers KV (`RECFLARE_PLAYER_SETTINGS`, key `player:<id>`).
|
||||
- `DELETE /playersettings` — `[Authorize]`. Removes a setting from the player's
|
||||
map. The client sends a bare form-urlencoded `key=PlayerShoppingBagId` (no
|
||||
`value`); a JSON body and a `?key=` query param are also read. Deleting a key
|
||||
that isn't stored is a no-op `200`, not a `404`.
|
||||
|
||||
> A full settings PUT would replace the player's _entire_ settings set on each
|
||||
> call; we merge instead, so a single-key PUT (e.g. `key=PlayerSessionCount`)
|
||||
> doesn't wipe the others.
|
||||
|
||||
> Emptying the map with DELETE puts the player back to a first read: the next
|
||||
> `GET` re-seeds the defaults.
|
||||
|
||||
## KV namespace
|
||||
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user