mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 20:45:39 +01:00
implemented the user view type and website sharing
This commit is contained in:
parent
7a3443cd06
commit
66e67c7a3b
19 changed files with 260 additions and 68 deletions
|
|
@ -19,7 +19,7 @@ export default async (req, res) => {
|
|||
}
|
||||
|
||||
if (req.method === 'POST') {
|
||||
const { username, password, account_uuid } = req.body;
|
||||
const { username, password, account_uuid, websiteIds, isViewer } = req.body;
|
||||
|
||||
const account = await getAccount({ username });
|
||||
|
||||
|
|
@ -31,6 +31,14 @@ export default async (req, res) => {
|
|||
username,
|
||||
password: hashPassword(password),
|
||||
accountUuid: account_uuid || uuid(),
|
||||
isViewer,
|
||||
viewwebsites: {
|
||||
create: websiteIds
|
||||
.map(id => parseInt(id))
|
||||
.map(id => ({
|
||||
website: { connect: { id } },
|
||||
})),
|
||||
},
|
||||
});
|
||||
|
||||
return ok(res, created);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue