Skip to content

Commit

Permalink
feat(GoalAchievement): add remove criteria action
Browse files Browse the repository at this point in the history
fix(GoalAchievement): review comments
fix(GoalSuggesstions): add query limit results
  • Loading branch information
LamaEats committed Jun 16, 2023
1 parent 5bce0e0 commit 95e73f5
Show file tree
Hide file tree
Showing 21 changed files with 821 additions and 596 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- CreateTable
CREATE TABLE "GoalAchiveCriteria" (
"id" TEXT NOT NULL,
"linkedGoalId" TEXT NOT NULL,
"goalId" TEXT NOT NULL,
"goalIdAsCriteria" TEXT,
"title" TEXT NOT NULL,
"weight" INTEGER NOT NULL,
Expand All @@ -20,10 +20,10 @@ CREATE UNIQUE INDEX "GoalAchiveCriteria_goalIdAsCriteria_key" ON "GoalAchiveCrit
CREATE INDEX "GoalAchiveCriteria_title_idx" ON "GoalAchiveCriteria"("title");

-- CreateIndex
CREATE INDEX "GoalAchiveCriteria_linkedGoalId_idx" ON "GoalAchiveCriteria"("linkedGoalId");
CREATE INDEX "GoalAchiveCriteria_goalId_idx" ON "GoalAchiveCriteria"("goalId");

-- AddForeignKey
ALTER TABLE "GoalAchiveCriteria" ADD CONSTRAINT "GoalAchiveCriteria_linkedGoalId_fkey" FOREIGN KEY ("linkedGoalId") REFERENCES "Goal"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
ALTER TABLE "GoalAchiveCriteria" ADD CONSTRAINT "GoalAchiveCriteria_goalId_fkey" FOREIGN KEY ("goalId") REFERENCES "Goal"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "GoalAchiveCriteria" ADD CONSTRAINT "GoalAchiveCriteria_goalIdAsCriteria_fkey" FOREIGN KEY ("goalIdAsCriteria") REFERENCES "Goal"("id") ON DELETE SET NULL ON UPDATE CASCADE;
Expand Down
6 changes: 3 additions & 3 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ model GoalHistory {

model GoalAchiveCriteria {
id String @id @default(cuid())
linkedGoal Goal @relation("GoalCriterion", fields: [linkedGoalId], references: [id])
linkedGoalId String
goal Goal @relation("GoalCriterion", fields: [goalId], references: [id])
goalId String
goalAsCriteria Goal? @relation("GoalAsCriteria", fields: [goalIdAsCriteria], references: [id])
goalIdAsCriteria String? @unique
title String
Expand All @@ -366,5 +366,5 @@ model GoalAchiveCriteria {
updatedAt DateTime @default(now()) @updatedAt
@@index([title])
@@index([linkedGoalId])
@@index([goalId])
}
272 changes: 0 additions & 272 deletions src/components/CreateCriteriaForm/CreateCreteriaForm.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Weight is required": "",
"Weight must be integer": "",
"Weight": "",
"Weight": "No more than {upTo}",
"Criteria or Goal": "",
"Add achivement criteria": "",
"Add achievement criteria": "",
"Weight must be in range": "Weight must be between 1 and {upTo}",
"Add": ""
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Weight is required": "Вес обязателен",
"Weight must be integer": "Вес должен быть числом",
"Weight": "Вес критерия",
"Weight": "Не более {upTo}",
"Criteria or Goal": "Критерий или цель",
"Add achivement criteria": "Добавить критерий",
"Add achievement criteria": "Добавить критерий",
"Weight must be in range": "Вес критерия должен быть от 1 до {upTo}",
"Add": "Добавить"
}
Loading

0 comments on commit 95e73f5

Please sign in to comment.