Save and load dashboards

This commit is contained in:
eikek
2022-01-26 21:23:48 +01:00
parent e83bf6b750
commit 3ff7e255b4
24 changed files with 1647 additions and 192 deletions

View File

@ -5,7 +5,10 @@
-}
module Util.Result exposing (fold)
module Util.Result exposing (combine, fold)
import Api.Model.BasicResult exposing (BasicResult)
import Set
fold : (a -> x) -> (b -> x) -> Result b a -> x
@ -16,3 +19,12 @@ fold fa fb rba =
Err b ->
fb b
combine : BasicResult -> BasicResult -> BasicResult
combine r1 r2 =
BasicResult (r1.success && r2.success)
(Set.fromList [ r1.message, r2.message ]
|> Set.toList
|> String.join ", "
)