Update packages/server/src/services/proprietary/license-key.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Mauricio Siu
2026-02-18 01:39:59 -06:00
committed by GitHub
parent 4e8d37bff7
commit 605931861b

View File

@@ -3,18 +3,12 @@ import { organization, user } from "@dokploy/server/db/schema";
import { eq } from "drizzle-orm";
export const hasValidLicense = async (organizationId: string) => {
// we need to find the owner of the organization
const organizationResult = await db.query.organization.findFirst({
where: eq(organization.id, organizationId),
columns: { ownerId: true },
});
const ownerId = await getOrganizationOwnerId(organizationId);
if (!organizationResult) {
if (!ownerId) {
return false;
}
const ownerId = organizationResult?.ownerId;
const currentUser = await db.query.user.findFirst({
where: eq(user.id, ownerId),
columns: {