Merge pull request #1069 from nktnet1/accessed-typo

chore: typo "accesed" changed to "accessed" for TS code
This commit is contained in:
Mauricio Siu
2025-01-18 17:35:04 -06:00
committed by GitHub
4 changed files with 48 additions and 48 deletions

View File

@@ -40,11 +40,11 @@ export const users = pgTable("user", {
canAccessToTraefikFiles: boolean("canAccessToTraefikFiles")
.notNull()
.default(false),
accesedProjects: text("accesedProjects")
accessedProjects: text("accesedProjects")
.array()
.notNull()
.default(sql`ARRAY[]::text[]`),
accesedServices: text("accesedServices")
accessedServices: text("accesedServices")
.array()
.notNull()
.default(sql`ARRAY[]::text[]`),
@@ -73,8 +73,8 @@ const createSchema = createInsertSchema(users, {
token: z.string().min(1),
isRegistered: z.boolean().optional(),
adminId: z.string(),
accesedProjects: z.array(z.string()).optional(),
accesedServices: z.array(z.string()).optional(),
accessedProjects: z.array(z.string()).optional(),
accessedServices: z.array(z.string()).optional(),
canCreateProjects: z.boolean().optional(),
canCreateServices: z.boolean().optional(),
canDeleteProjects: z.boolean().optional(),
@@ -106,8 +106,8 @@ export const apiAssignPermissions = createSchema
canCreateServices: true,
canDeleteProjects: true,
canDeleteServices: true,
accesedProjects: true,
accesedServices: true,
accessedProjects: true,
accessedServices: true,
canAccessToTraefikFiles: true,
canAccessToDocker: true,
canAccessToAPI: true,

View File

@@ -54,7 +54,7 @@ export const addNewProject = async (authId: string, projectId: string) => {
await db
.update(users)
.set({
accesedProjects: [...user.accesedProjects, projectId],
accessedProjects: [...user.accessedProjects, projectId],
})
.where(eq(users.authId, authId));
};
@@ -64,7 +64,7 @@ export const addNewService = async (authId: string, serviceId: string) => {
await db
.update(users)
.set({
accesedServices: [...user.accesedServices, serviceId],
accessedServices: [...user.accessedServices, serviceId],
})
.where(eq(users.authId, authId));
};
@@ -73,8 +73,8 @@ export const canPerformCreationService = async (
userId: string,
projectId: string,
) => {
const { accesedProjects, canCreateServices } = await findUserByAuthId(userId);
const haveAccessToProject = accesedProjects.includes(projectId);
const { accessedProjects, canCreateServices } = await findUserByAuthId(userId);
const haveAccessToProject = accessedProjects.includes(projectId);
if (canCreateServices && haveAccessToProject) {
return true;
@@ -87,8 +87,8 @@ export const canPerformAccessService = async (
userId: string,
serviceId: string,
) => {
const { accesedServices } = await findUserByAuthId(userId);
const haveAccessToService = accesedServices.includes(serviceId);
const { accessedServices } = await findUserByAuthId(userId);
const haveAccessToService = accessedServices.includes(serviceId);
if (haveAccessToService) {
return true;
@@ -101,8 +101,8 @@ export const canPeformDeleteService = async (
authId: string,
serviceId: string,
) => {
const { accesedServices, canDeleteServices } = await findUserByAuthId(authId);
const haveAccessToService = accesedServices.includes(serviceId);
const { accessedServices, canDeleteServices } = await findUserByAuthId(authId);
const haveAccessToService = accessedServices.includes(serviceId);
if (canDeleteServices && haveAccessToService) {
return true;
@@ -135,9 +135,9 @@ export const canPerformAccessProject = async (
authId: string,
projectId: string,
) => {
const { accesedProjects } = await findUserByAuthId(authId);
const { accessedProjects } = await findUserByAuthId(authId);
const haveAccessToProject = accesedProjects.includes(projectId);
const haveAccessToProject = accessedProjects.includes(projectId);
if (haveAccessToProject) {
return true;