Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Task" ADD COLUMN "archived" BOOLEAN NOT NULL DEFAULT false;
1 change: 1 addition & 0 deletions crushit/api/db/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ model Task {
pomodoro PomodoroTimer[] @relation("TaskTimer")
taskDates TaskDate[] @relation("TaskDate")
appointments Appointment[] @relation("TaskAppointment")
archived Boolean @default(false)
}

model Appointment {
Expand Down
1 change: 1 addition & 0 deletions crushit/api/src/graphql/tasks.sdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@ export const schema = gql`
createTask(input: CreateTaskInput!): Task! @requireAuth
updateTask(id: Int!, input: UpdateTaskInput!): Task! @requireAuth
deleteTask(id: Int!): Task! @requireAuth
startNewDay(date: DateTime!): Boolean! @requireAuth
}
`
17 changes: 17 additions & 0 deletions crushit/api/src/services/tasks/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,20 @@ export const Task = {
return db.task.findUnique({ where: { id: root?.id } }).taskDates()
},
}


export const archiveTasksForDay = async ({ date }) => {
const archivedTasks = await db.task.updateMany({
where: {
scheduledDate: date,
NOT: {
status: 'ARCHIVED',
},
},
data: {
status: 'ARCHIVED',
},
});

return archivedTasks.count;
};
1 change: 1 addition & 0 deletions crushit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},
"packageManager": "yarn@3.6.3",
"dependencies": {
"@redwoodjs/cli": "^6.5.0",
"googleapis": "^129.0.0",
"tailwind": "^4.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Pass props to your component by passing an `args` object to your story
//
// ```jsx
// export const Primary = {
// args: {
// propName: propValue
// }
// }
// ```
//
// See https://storybook.js.org/docs/react/writing-stories/args.

import AppointmentDetails from './AppointmentDetails'

export default { component: AppointmentDetails }

export const Primary = {}
Loading