This commit is contained in:
ThatOneCalculator 2022-09-13 17:52:31 -07:00
parent 3ce563cdfb
commit 25b032e1aa
2 changed files with 13 additions and 14 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "calckey", "name": "calckey",
"version": "12.119.0-calc-rc.2.1", "version": "12.119.0-calc-rc.2.2",
"codename": "aqua", "codename": "aqua",
"repository": { "repository": {
"type": "git", "type": "git",

View file

@ -59,9 +59,8 @@ async function fetch() {
groupId: props.groupId, groupId: props.groupId,
}).then(gp => { }).then(gp => {
group.value = gp; group.value = gp;
console.log(gp);
os.api('users/show', { os.api('users/show', {
userIds: group.userIds userIds: group.value.userIds
}).then(us => { }).then(us => {
users.value = us; users.value = us;
}); });
@ -73,41 +72,41 @@ fetch();
function invite() { function invite() {
os.selectUser().then(user => { os.selectUser().then(user => {
os.apiWithDialog('users/groups/invite', { os.apiWithDialog('users/groups/invite', {
groupId: group.id, groupId: group.value.id,
userId: user.id userId: user.id,
}); });
}); });
} }
function removeUser(user) { function removeUser(user) {
os.api('users/groups/pull', { os.api('users/groups/pull', {
groupId: group.id, groupId: group.value.id,
userId: user.id userId: user.id
}).then(() => { }).then(() => {
users.value = users.filter(x => x.id !== user.id); users.value = users.value.filter(x => x.id !== user.id);
}); });
} }
async function renameGroup() { async function renameGroup() {
const { canceled, result: name } = await os.inputText({ const { canceled, result: name } = await os.inputText({
title: i18n.ts.groupName, title: i18n.ts.groupName,
default: group.name default: group.value.name
}); });
if (canceled) return; if (canceled) return;
await os.api('users/groups/update', { await os.api('users/groups/update', {
groupId: group.id, groupId: group.value.id,
name: name name: name
}); });
group.name = name; group.value.name = name;
} }
function transfer() { function transfer() {
os.selectUser().then(user => { os.selectUser().then(user => {
os.apiWithDialog('users/groups/transfer', { os.apiWithDialog('users/groups/transfer', {
groupId: group.id, groupId: group.value.id,
userId: user.id userId: user.id,
}); });
}); });
} }
@ -115,12 +114,12 @@ function transfer() {
async function deleteGroup() { async function deleteGroup() {
const { canceled } = await os.confirm({ const { canceled } = await os.confirm({
type: 'warning', type: 'warning',
text: i18n.t('removeAreYouSure', { x: group.name }), text: i18n.t('removeAreYouSure', { x: group.value.name }),
}); });
if (canceled) return; if (canceled) return;
await os.apiWithDialog('users/groups/delete', { await os.apiWithDialog('users/groups/delete', {
groupId: group.id, groupId: group.value.id,
}); });
router.push('/my/groups'); router.push('/my/groups');
} }