Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

axel7083
Copy link
Contributor

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 #1232 with the user icon.

Before After
{
    "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
}
{
    "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
    }
}

@ethteck
Copy link
Member

ethteck commented May 20, 2024

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
Copy link
Contributor Author

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!

@ethteck ethteck merged commit c208896 into decompme:main May 20, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants