Skip to content

Commit b8c2e40

Browse files
committed
set 20 max projects
1 parent e866a1c commit b8c2e40

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

dashboard/server/api/project/create.post.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ export default defineEventHandler(async event => {
1616
const userData = getRequestUser(event);
1717
if (!userData?.logged) return setResponseStatus(event, 400, 'NotLogged');
1818

19-
const userSettings = await UserSettingsModel.findOne({ user_id: userData.id }, { max_projects: true });
20-
21-
const maxProjects = userSettings?.max_projects || 3;
19+
const maxProjects = 20;
2220

2321
const existingUserProjects = await ProjectModel.countDocuments({ owner: userData.id });
2422
if (existingUserProjects >= maxProjects) return setResponseStatus(event, 400, 'Already have max number of projects');

dashboard/server/api/user/max_projects.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { AuthContext } from "~/server/middleware/01-authorization";
44
export default defineEventHandler(async event => {
55
const userData: AuthContext = getRequestUser(event) as any;
66
if (!userData.logged) return;
7-
const userSettings = await UserSettingsModel.findOne({ user_id: userData.id }, { max_projects: 1 });
8-
return userSettings?.max_projects || 3;
7+
// const userSettings = await UserSettingsModel.findOne({ user_id: userData.id }, { max_projects: 1 });
8+
// return userSettings?.max_projects || 3;
9+
return 20;
910
});

0 commit comments

Comments
 (0)