mirror of
https://github.com/hex248/sprint.git
synced 2026-02-09 02:33:02 +00:00
removed all free tier restrictions
This commit is contained in:
@@ -2,11 +2,11 @@ import { IssueCreateRequestSchema } from "@sprint/shared";
|
||||
import type { AuthedRequest } from "../../auth/middleware";
|
||||
import {
|
||||
createIssue,
|
||||
FREE_TIER_LIMITS,
|
||||
getOrganisationIssueCount,
|
||||
// FREE_TIER_LIMITS,
|
||||
// getOrganisationIssueCount,
|
||||
getOrganisationMemberRole,
|
||||
getProjectByID,
|
||||
getUserById,
|
||||
// getUserById,
|
||||
} from "../../db/queries";
|
||||
import { errorResponse, parseJsonBody } from "../../validation";
|
||||
|
||||
@@ -34,17 +34,17 @@ export default async function issueCreate(req: AuthedRequest) {
|
||||
}
|
||||
|
||||
// check free tier limit
|
||||
const user = await getUserById(req.userId);
|
||||
if (user && user.plan !== "pro") {
|
||||
const issueCount = await getOrganisationIssueCount(project.organisationId);
|
||||
if (issueCount >= FREE_TIER_LIMITS.issuesPerOrganisation) {
|
||||
return errorResponse(
|
||||
`free tier is limited to ${FREE_TIER_LIMITS.issuesPerOrganisation} issues per organisation. upgrade to pro for unlimited issues.`,
|
||||
"FREE_TIER_ISSUE_LIMIT",
|
||||
403,
|
||||
);
|
||||
}
|
||||
}
|
||||
// const user = await getUserById(req.userId);
|
||||
// if (user && user.plan !== "pro") {
|
||||
// const issueCount = await getOrganisationIssueCount(project.organisationId);
|
||||
// if (issueCount >= FREE_TIER_LIMITS.issuesPerOrganisation) {
|
||||
// return errorResponse(
|
||||
// `free tier is limited to ${FREE_TIER_LIMITS.issuesPerOrganisation} issues per organisation. upgrade to pro for unlimited issues.`,
|
||||
// "FREE_TIER_ISSUE_LIMIT",
|
||||
// 403,
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
const issue = await createIssue(
|
||||
project.id,
|
||||
|
||||
Reference in New Issue
Block a user