mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Added website and team providers.
This commit is contained in:
parent
dbb3801e66
commit
cc273092d5
25 changed files with 123 additions and 98 deletions
|
|
@ -57,17 +57,17 @@ export default async (
|
|||
|
||||
const { name, domain, shareId } = req.body;
|
||||
|
||||
let website;
|
||||
|
||||
try {
|
||||
website = await updateWebsite(websiteId, { name, domain, shareId });
|
||||
const website = await updateWebsite(websiteId, { name, domain, shareId });
|
||||
|
||||
return ok(res, website);
|
||||
} catch (e: any) {
|
||||
if (e.message.includes('Unique constraint') && e.message.includes('share_id')) {
|
||||
return serverError(res, 'That share ID is already taken.');
|
||||
}
|
||||
}
|
||||
|
||||
return ok(res, website);
|
||||
return serverError(res, e);
|
||||
}
|
||||
}
|
||||
|
||||
if (req.method === 'DELETE') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue