decompme / decomp.me

Collaborative decompilation and reverse engineering website
https://decomp.me
MIT License
348 stars 108 forks source link

feat(presets): include profile in preset owner field #1252

Closed axel7083 closed 1 month ago

axel7083 commented 1 month ago

In scratch api, we get the full profile with username and user's id in owner field. However in preset we were only getting the id.

This will allow us to improve the Preset card, introduced by https://github.com/decompme/decomp.me/pull/1232 with the user icon.
ethteck commented 1 month ago

We should probably adjust the corresponding api.ts type to change owner from a number to a User or whatever in this PR, to keep things in-sync

axel7083 commented 1 month ago

We should probably adjust the corresponding api.ts type to change owner from a number to a User or whatever in this PR, to keep things in-sync

Oh yeah nice catch!

Before After
```json { "id": 2, "name": "random", "platform": "dummy", "compiler": "dummy", "assembler_flags": "-dummy-asm", "compiler_flags": "-dummy-compiler", "diff_flags": {}, "decompiler_flags": "-decompiler", "libraries": [], "num_scratches": 0, "owner": 2 } ``` ```json { "id": 2, "name": "random", "platform": "dummy", "compiler": "dummy", "assembler_flags": "-dummy-asm", "compiler_flags": "-dummy-compiler", "diff_flags": {}, "decompiler_flags": "-decompiler", "libraries": [], "num_scratches": 0, "owner": { "is_anonymous": false, "id": 2, "is_online": true, "is_admin": false, "username": "axel7083", "github_id": 42176370 } } ```