Change some DTOs to return data as array instead of {someData: []} when there is only one kind of data being returned.
Examples: organisations, campaigns, teams, projects/{project_id}/campaigns/, countries, interests, users/queries/favorites/, /api/v2/system/authentication/applications/, /api/v2/tasks/issues/categories/.
One exception where this pattern doesn't work is when we have pagination on the result.
When there isn't results, instead of an error, it should return an empty array. The endpoints /api/v2/projects/{project_id}/comments/ and licenses are returning an error.
Change some DTOs to return data as array instead of
{someData: []}
when there is only one kind of data being returned. Examples: organisations, campaigns, teams,projects/{project_id}/campaigns/
, countries, interests,users/queries/favorites/
,/api/v2/system/authentication/applications/
,/api/v2/tasks/issues/categories/
.One exception where this pattern doesn't work is when we have pagination on the result.
When there isn't results, instead of an error, it should return an empty array. The endpoints
/api/v2/projects/{project_id}/comments/
andlicenses
are returning an error.Related to https://github.com/hotosm/tasking-manager/issues/1930