mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-27 01:55:24 +02:00
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:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user