mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 19:14:16 +00:00
added getUserBadges
method
This commit is contained in:
parent
030d38335f
commit
4be1029ec7
@ -75,6 +75,26 @@ export default class User {
|
|||||||
return User.hasRole("admin")
|
return User.hasRole("admin")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async getUserBadges(user_id) {
|
||||||
|
if (!User.bridge) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!user_id) {
|
||||||
|
user_id = await User.selfUserId()
|
||||||
|
}
|
||||||
|
|
||||||
|
const { data } = await app.api.customRequest("main", {
|
||||||
|
method: "GET",
|
||||||
|
url: "/user/badges",
|
||||||
|
params: {
|
||||||
|
user_id: user_id,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
static async register(payload) {
|
static async register(payload) {
|
||||||
if (!User.bridge) {
|
if (!User.bridge) {
|
||||||
return false
|
return false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user