Skip to content

Conversation

@Ferks-FK
Copy link
Collaborator

@Ferks-FK Ferks-FK commented Jul 13, 2025

Refactor all API endpoints to use JsonResource for responses.
As well as fix fields related to displaying and updating credits. (#1256)

it is necessary to decide on the maximum amount of credits a user can have on their account, in this PR it is currently set to 50K, this should be discussed before merging.

Due to the use of JsonResource in this PR's API responses, the format in which the data is delivered has changed slightly.
Responses from a list of resources, for example: /api/users now have more organized pagination fields and the user data comes within attribute “data” array.
Example:

{
	"data": [
		{
			"id": 1,
			"name": "Ferks",
			"email": "[email protected]",
			"credits": 50000,
			"server_limit": 25,
                }
        ]
}

The same “data” attribute will be present on specific resource routes, such as /api/users/1.

Also adds nested includes that can be useful for user routes.
This makes it possible to do: api/users?include=servers.product and api/users?include=vouchers.users.

Copy link
Collaborator

@AVMG20 AVMG20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good changes! I like the implementation of resource classes—this helps a lot with consistency in the API.

Besides some minor issues, it's a good PR for making the API better!

@Ferks-FK Ferks-FK requested a review from AVMG20 July 17, 2025 17:57
@Ferks-FK Ferks-FK linked an issue Jul 30, 2025 that may be closed by this pull request
@MrWeez MrWeez added the High Priority Critical. Act quickly for resolution label Aug 23, 2025
@1day2die
Copy link
Collaborator

1day2die commented Nov 6, 2025

@Ferks-FK can you post an update here on github?

@Ferks-FK
Copy link
Collaborator Author

Ferks-FK commented Jan 1, 2026

After further analyzing the purpose of the PR, I decided to remove the API documentation using the scribe.
Because this is a fix PR.

@Ferks-FK Ferks-FK changed the title Fix api, add api resource response and more stuff. Fix api, and add api resource response. Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority Critical. Act quickly for resolution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The API layer is not updated.

4 participants