Added more necessary endpoints to ApiService.kt

This commit is contained in:
Marta Borgia Leiva 2026-02-12 11:33:37 +01:00
parent a8f9a69d58
commit e4280f0490
3 changed files with 36 additions and 4 deletions

View file

@ -40,6 +40,18 @@ interface ApiService {
@GET("projects/{project_id}/users/")
suspend fun getProjectUsers(@Path("project_id") projectId: Int): Response<List<UserBase>>
@POST("projects/{project_id}/users/")
suspend fun addProjectCollaborator(
@Path("project_id") projectId: Int,
@Body email: Map<String, String>
): Response<Unit>
@DELETE("projects/{project_id}/users/{user_id}/")
suspend fun removeProjectCollaborator(
@Path("project_id") projectId: Int,
@Path("user_id") userId: Int
): Response<Unit>
@POST("projects/")
suspend fun createProject(@Body projectCreate: ProjectCreate): Response<ProjectBase>
@ -57,4 +69,17 @@ interface ApiService {
@POST("projects/{project_id}/tasks/")
suspend fun createTask(@Path("project_id") projectId: Int, @Body taskBase: TaskBase): Response<TaskBase>
@PUT("projects/{project_id}/tasks/{task_id}/")
suspend fun updateProjectTask(
@Path("project_id") projectId: Int,
@Path("task_id") taskId: Int,
@Body taskUpdate: TaskUpdate
): Response<Unit>
@DELETE("projects/{project_id}/tasks/{task_id}/")
suspend fun deleteProjectTask(
@Path("project_id") projectId: Int,
@Path("task_id") taskId: Int
): Response<Unit>
}

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="task_status_options">
<item>Pending</item>
<item>In progress</item>
<item>Completed</item>
<item>Stashed</item>
<item>Failed</item>
</string-array>
</resources>