Skip to content

Commit

Permalink
Adapt new schema to remmove deleted targets
Browse files Browse the repository at this point in the history
  • Loading branch information
cquiroz committed Nov 5, 2024
1 parent 75a514a commit 8c70f6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion explore/src/clue/scala/queries/common/TargetQueriesGQL.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ object TargetQueriesGQL:
val document = """
subscription($targetId: TargetId!) {
targetEdit(input: {targetId: $targetId}) {
id
targetId
}
}
"""
Expand All @@ -85,6 +85,7 @@ object TargetQueriesGQL:
val document = s"""
subscription($$input: TargetEditInput!) {
targetEdit(input: $$input) {
targetId
value $TargetWithIdSubquery
meta:value {
existence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ trait CacheModifierUpdaters {
protected def modifyTargets(targetEdit: TargetEdit): ProgramSummaries => ProgramSummaries =
ProgramSummaries.targets
.modify: targets =>
if (targetEdit.meta.existence === Existence.Present)
targets.updated(targetEdit.value.id, targetEdit.value.target)
else
targets.removed(targetEdit.value.id)
if (targetEdit.meta.exists(_.existence === Existence.Present))
targetEdit.value
.map(t => targets.updated(targetEdit.targetId, t.target))
.getOrElse(targets.removed(targetEdit.targetId))
else targets.removed(targetEdit.targetId)

protected def modifyObservations(
observationEdit: ObservationEdit
Expand Down
4 changes: 2 additions & 2 deletions project/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ object Versions {
val lucumaITC = "0.22.6"
val lucumaReact = "0.71.2"
val lucumaRefined = "0.1.3"
val lucumaSchemas = "0.106.0"
val lucumaOdbSchema = "0.16.0"
val lucumaSchemas = "0.107.0"
val lucumaOdbSchema = "0.16.1"
val lucumaSSO = "0.6.27"
val lucumaUI = "0.121.0"
val monocle = "3.3.0"
Expand Down

0 comments on commit 8c70f6b

Please sign in to comment.