Skip to content
Draft
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"lucide-react": "^0.503.0",
"next": "^15.3.0",
"next-themes": "^0.4.1",
"next-safe-action": "^7.10.2",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-hook-form": "^7.54.1",
Expand Down
32 changes: 32 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions src/libs/safe-action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import * as Sentry from "@sentry/nextjs"
import { createSafeActionClient } from "next-safe-action"
import { z } from "zod"

export const actionClient = createSafeActionClient({
defineMetadataSchema() {
return z.object({
actionName: z.string()
})
},
handleServerError(error, utils) {
const { clientInput, metadata } = utils

Sentry.captureException(error, (scope) => {
scope.clear()
scope.setContext("serverError", { message: error.message })
scope.setContext("metadata", { actionName: metadata.actionName })
scope.setContext("clientInput", { clientInput })
return scope
})

// We don't want to leak any sensitive data
if (error.constructor.name === "DatabaseError") {
return "Database Error: Your data did not save. Support will be notified."
}

console.error("Action error:", error.message)
return error.message
}
})
4 changes: 2 additions & 2 deletions user-stories.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
13. [x] Users can have Employee, Manager, or Admin permissions
14. [ ] All users can create and view tickets
15. [ ] All users can create, edit and view customers
16. [ ] Employees can only edit their assigned tickets
17. [ ] Managers and Admins can view, edit, and delete all tickets
16. [x] Employees can only edit their assigned tickets
17. [x] Managers and Admins can view, edit, and complete all tickets
18. [ ] Desktop mode is most important but the app should be usable on tablet devices as well.
19. [x] Light / Dark mode option requested by employees
20. [x] Expects quick support if anything goes wrong with the app