-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Roles] Click on user and change their role
- Loading branch information
Showing
11 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/src/main/java/buggy/plandroid/com/plandroidbugs/PGApiService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
package buggy.plandroid.com.plandroidbugs | ||
|
||
import retrofit2.http.GET | ||
import buggy.plandroid.com.plandroidbugs.UserList | ||
import buggy.plandroid.com.plandroidbugs.UserWire | ||
import io.reactivex.Observable | ||
import retrofit2.http.PATCH | ||
import okhttp3.ResponseBody | ||
import retrofit2.Call | ||
import retrofit2.http.Body | ||
import retrofit2.http.Path | ||
|
||
interface PGApiService { | ||
@GET("projects/fc6facf8-c69c-4780-bac1-1774bd91cc8c/users") | ||
fun getAllUsers(): Observable<UserList> | ||
|
||
@GET("projects/fc6facf8-c69c-4780-bac1-1774bd91cc8c/users/540e0bdcde37b40013533497") | ||
fun getUser(): Call<UserWire> | ||
|
||
@PATCH("projects/fc6facf8-c69c-4780-bac1-1774bd91cc8c/users/{userId}") | ||
fun changeUserRole( | ||
@Path("userId") userId: String, | ||
@Body parameters: Map<String, String> | ||
): Observable<ResponseBody?> | ||
} |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/buggy/plandroid/com/plandroidbugs/Role.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package buggy.plandroid.com.plandroidbugs | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties | ||
import com.fasterxml.jackson.annotation.JsonProperty | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
data class Role( | ||
@JsonProperty(value = "uid") | ||
val uid: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/src/main/java/buggy/plandroid/com/plandroidbugs/app/Migration1To2.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package buggy.plandroid.com.plandroidbugs.app | ||
|
||
import androidx.room.migration.Migration | ||
import androidx.sqlite.db.SupportSQLiteDatabase | ||
|
||
|
||
class Migration1To2 : Migration(1, 2) { | ||
override fun migrate(database: SupportSQLiteDatabase) { | ||
database.execSQL("ALTER TABLE users ADD role_uid TEXT") | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters