Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions backend/src/controllers/permanence.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const validatePermanenceData = (start_at: string, end_at: string) => {
export const createPermanence = async (req: Request, res: Response) => {
const { name, description, location, start_at, end_at, capacity, difficulty, respoId } = req.body;

if (!name || !location || !start_at || !end_at || !capacity || !difficulty || !respoId) {
if (!name || !location || !start_at || !end_at || !capacity || !difficulty) {
Error(res, { msg: "Tous les champs sont requis" });
return;
}
Expand Down Expand Up @@ -59,8 +59,7 @@ export const createPermanence = async (req: Request, res: Response) => {

export const updatePermanence = async (req: Request, res: Response) => {
const { permId, name, description, location, start_at, end_at, capacity, difficulty, respoId } = req.body;

if (!name || !location || !start_at || !end_at || !capacity || !difficulty || !respoId) {
if (!name || !location || !start_at || !end_at || !capacity || !difficulty) {
Error(res, { msg: "Tous les champs sont requis" });
return;
}
Expand Down
10 changes: 10 additions & 0 deletions backend/src/database/migrations/0021_colossal_madame_web.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE "user_tent" (
"user_id_1" integer,
"user_id_2" integer,
"confirmed" boolean DEFAULT false,
"created_at" timestamp DEFAULT now(),
CONSTRAINT "user_tent_user_id_1_user_id_2_pk" PRIMARY KEY("user_id_1","user_id_2")
);
--> statement-breakpoint
ALTER TABLE "user_tent" ADD CONSTRAINT "user_tent_user_id_1_users_id_fk" FOREIGN KEY ("user_id_1") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "user_tent" ADD CONSTRAINT "user_tent_user_id_2_users_id_fk" FOREIGN KEY ("user_id_2") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
Loading