chore(docs): add docker setup guide. remove prev code implementation

This commit is contained in:
kaf-lamed-beyt
2023-07-17 12:17:09 +01:00
parent 6099e06a71
commit eafe6a0d7b
2 changed files with 0 additions and 84 deletions
@@ -1,42 +0,0 @@
import { User } from "~/models/user.server";
import { PrismaClient, prisma } from "~/db.server";
import { Job } from "~/models/job.server";
export class JobsListPresenter {
#prismaClient: PrismaClient;
constructor(prismaClient: PrismaClient = prisma) {
this.#prismaClient = prismaClient;
}
public async call({
slug,
userId,
}: Pick<Job, "slug"> & { userId: User["id"] }) {
const project = await this.#prismaClient.project.findFirst({
where: {
slug,
organization: {
members: {
some: {
userId,
},
},
},
},
select: {
jobs: {
where: {
internal: false,
},
},
},
});
if (!project) {
return undefined;
}
return project.jobs.filter((job) => !job.internal);
}
}
@@ -27,48 +27,6 @@ import {
trimTrailingSlash,
} from "~/utils/pathBuilder";
import { BreadcrumbLink } from "~/components/navigation/NavBar";
import { requireUserId } from "~/services/session.server";
import { LoaderArgs } from "@remix-run/server-runtime";
import invariant from "tiny-invariant";
import { typedjson } from "remix-typedjson";
import { analytics } from "~/services/analytics.server";
import { JobsListPresenter } from "~/presenters/JobPresenter.server";
export const loader = async ({ request, params }: LoaderArgs) => {
const { projectParam } = params;
const userId = await requireUserId(request);
invariant(projectParam, "projectParam not found");
try {
const jobsPresenter = new JobsListPresenter();
const jobs = await jobsPresenter.call({
userId,
slug: projectParam,
});
if (!jobs) {
throw new Response("Not found", {
status: 404,
statusText: `Project with this ${projectParam} was not found in your Organization`,
});
}
return typedjson({
jobs,
});
} catch (error) {
if (error instanceof Response) {
throw error;
}
console.error(error);
throw new Response(undefined, {
status: 400,
statusText:
"Something went wrong. If the problem persists contact support",
});
}
};
export const handle: Handle = {
breadcrumb: (match) => (