mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: add linking UGs to Users
This commit is contained in:
parent
d1d817678b
commit
e173a32e3c
9 changed files with 235 additions and 20 deletions
|
|
@ -19,6 +19,24 @@ export async function createUserGroup(body: any) {
|
|||
return res
|
||||
}
|
||||
|
||||
export async function linkUserToUserGroup(usergroup_id: any, user_id: any) {
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}usergroups/${usergroup_id}/add_users?user_ids=${user_id}`,
|
||||
RequestBody('POST', null, null)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function unLinkUserToUserGroup(usergroup_id: any, user_id: any) {
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}usergroups/${usergroup_id}/remove_users?user_ids=${user_id}`,
|
||||
RequestBody('DELETE', null, null)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function deleteUserGroup(usergroup_id: number) {
|
||||
const result: any = await fetch(
|
||||
`${getAPIUrl()}usergroups/${usergroup_id}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue