Skip to content

Commit

Permalink
fix: use kebab-case for category deserialization (#154)
Browse files Browse the repository at this point in the history
I noticed that `update_snap_categories` wasn't working when running the
ratings server locally:
```
{"timestamp":"2024-12-13T11:31:42.208055Z","level":"ERROR","message":"unable to update snap categories: Matching variant not found","snap_id":"3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk","target":"ratings::ratings::categories","filename":"src/ratings/categories.rs","line_number":55,"threadId":"ThreadId(16)"}
```

The `get_snap_categories_works` test (which is skipped in CI since it's
sending queries to snapcraft.io) was failing as well.
  • Loading branch information
d-loose authored Dec 13, 2024
2 parents c5a3418 + f70e551 commit 897b0bc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/db/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use sqlx::{PgConnection, Postgres, QueryBuilder};
strum::FromRepr,
)]
#[repr(i32)]
#[strum(serialize_all = "kebab-case")]
pub enum Category {
ArtAndDesign = 0,
BookAndReference = 1,
Expand Down

0 comments on commit 897b0bc

Please sign in to comment.