Skip to content

Commit

Permalink
allow history to be written to DB
Browse files Browse the repository at this point in the history
  • Loading branch information
chetbox committed Dec 27, 2023
1 parent e8cffce commit 5c66a7b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions database/rules.bolt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ path /canvas/the-one-and-only/canvas {
write() { true }
}

path /canvas/the-one-and-only/history/{id} {
write() { createOnly(this) }
}

type Canvas {
depth: Integer;
canvas: Square<Square<Square<Square<Square<Square<Square<Color>>>>>>>;
Expand Down Expand Up @@ -42,3 +46,9 @@ type ColorHistoryItem extends HistoryItem<Color> {}
type CurrentTimestamp extends Number {
validate() { this == now }
}

// Helper functions

createOnly(value) {
prior(value) == null && value != null
}

0 comments on commit 5c66a7b

Please sign in to comment.