mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
Teams refactor: removed team websites.
This commit is contained in:
parent
0d442b751d
commit
f85393f8df
23 changed files with 190 additions and 351 deletions
|
|
@ -68,7 +68,12 @@ export default async (
|
|||
});
|
||||
}
|
||||
|
||||
log(`Login from ip ${getIpAddress(req)} with username "${username.replace(/["\r\n]/g, '')}" failed.`);
|
||||
log(
|
||||
`Login from ip ${getIpAddress(req)} with username "${username.replace(
|
||||
/["\r\n]/g,
|
||||
'',
|
||||
)}" failed.`,
|
||||
);
|
||||
|
||||
return unauthorized(res, 'message.incorrect-username-password');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import { pageInfo } from 'lib/schema';
|
|||
import { NextApiResponse } from 'next';
|
||||
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
|
||||
import { getWebsitesByTeamId } from 'queries';
|
||||
import { createTeamWebsites } from 'queries/admin/teamWebsite';
|
||||
|
||||
export interface TeamWebsiteRequestQuery extends SearchFilter {
|
||||
id: string;
|
||||
|
|
@ -52,17 +51,5 @@ export default async (
|
|||
return ok(res, websites);
|
||||
}
|
||||
|
||||
if (req.method === 'POST') {
|
||||
if (!(await canViewTeam(req.auth, teamId))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const { websiteIds } = req.body;
|
||||
|
||||
const websites = await createTeamWebsites(teamId, websiteIds);
|
||||
|
||||
return ok(res, websites);
|
||||
}
|
||||
|
||||
return methodNotAllowed(res);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue