-
Notifications
You must be signed in to change notification settings - Fork 0
Description
At the moment, there is no way for the client to know if a theme that it has saved has already been published by the user. This makes the UX poor, as a user may try to publish a theme that they have already published before again, but the request will fail.
We should add an endpoint that allows the user to get the themes for a certain author.
There are two approaches to this:
-
Any user is allowed to retrieve the list of themes for any author
In this approach, we will create a new endpoint:GET /api/v1/themes/list/{uuid}
This approach is the simplest, allowing anyone to retrieve the list of themes for any author on the MediaMod database.
-
Any user is allowed to retrieve the list of themes for themselves
In this approach, we will create a new endpoint:GET /api/v1/themes/list/{uuid}?sharedSecret=...
This endpoint requires the user to re-authenticate with the mojang session server so that we can verify that they are the owner of the UUID that they are requesting for. This approach seems kind-of needless, but I wanted to document it here anyways.
Both endpoints would return a JSON object similar to what's shown below:
{
"ok": true,
"themes": [
{
"id": "625b31ea0f3a53d26c96a9a2",
"name": "My Theme",
"author": "cbyrneee",
"upload_date":"2022-04-16T21:15:22.591Z",
"colors": {...}
}
]
}