Skip to content

Commit

Permalink
fix(GoalCriteria): drop unused fields
Browse files Browse the repository at this point in the history
  • Loading branch information
LamaEats committed Dec 21, 2023
1 parent 38e35a4 commit 538ce87
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/utils/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,14 +554,7 @@ export const updateLinkedGoalsByProject = async (projectId: string, activityId:
// mark criterias with these goals as deleted
const updateCriterias = ctx.goalAchieveCriteria.updateMany({
where: {
OR: [
{
criteriaGoalId: { in: goalIds.map(({ id }) => id) },
},
{
goalIdAsCriteria: { in: goalIds.map(({ id }) => id) },
},
],
criteriaGoalId: { in: goalIds.map(({ id }) => id) },
},
data: { deleted: true },
});
Expand All @@ -571,14 +564,7 @@ export const updateLinkedGoalsByProject = async (projectId: string, activityId:
// get all goals which current project's goals as criteria
const res = await ctx.goalAchieveCriteria.findMany({
where: {
OR: [
{
criteriaGoalId: { in: goalIds.map(({ id }) => id) },
},
{
goalIdAsCriteria: { in: goalIds.map(({ id }) => id) },
},
],
criteriaGoalId: { in: goalIds.map(({ id }) => id) },
},
include: {
criteriaGoal: {
Expand Down

0 comments on commit 538ce87

Please sign in to comment.