Skip to content

Commit

Permalink
Soft delete support
Browse files Browse the repository at this point in the history
  • Loading branch information
csansoon committed Oct 21, 2024
1 parent 4acc44d commit 79d0c57
Show file tree
Hide file tree
Showing 26 changed files with 3,175 additions and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function EvaluationBreadcrumbItems({
segments: string[]
}) {
const evaluationUuid = segments[0]!
const evaluationSegment = segments[1] as EvaluationRoutes | undefined

const { data: evaluations, isLoading } = useEvaluations()
const currentEvaluation = useMemo(
Expand All @@ -25,14 +26,17 @@ export function EvaluationBreadcrumbItems({

const options = useMemo<BreadcrumbSelectorOption[]>(() => {
if (!evaluations) return []
return evaluations.map((p) => ({
label: p.name,
href: segments[1]
? ROUTES.evaluations.detail({ uuid: p.uuid })[
segments[1] as EvaluationRoutes
].root
: ROUTES.evaluations.detail({ uuid: p.uuid }).root,
}))
return evaluations.map((p) => {
const baseRoute = ROUTES.evaluations.detail({ uuid: p.uuid })
const href = evaluationSegment
? (baseRoute[evaluationSegment]?.root ?? baseRoute.root)
: baseRoute.root

return {
label: p.name,
href,
}
})
}, [evaluations, segments])

return (
Expand Down
3 changes: 3 additions & 0 deletions packages/core/drizzle/0077_soft_delete_support.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "latitude"."commits" ADD COLUMN "deleted_at" timestamp;--> statement-breakpoint
ALTER TABLE "latitude"."provider_api_keys" ADD COLUMN "deleted_at" timestamp;--> statement-breakpoint
ALTER TABLE "latitude"."evaluations" ADD COLUMN "deleted_at" timestamp;
Loading

0 comments on commit 79d0c57

Please sign in to comment.