From 27b7a05ba05cdc1c92460942daad86b03c4fafe6 Mon Sep 17 00:00:00 2001 From: brase Date: Mon, 17 Feb 2020 20:05:24 +0100 Subject: [PATCH] removed autoopen for eventstore --- src/Server/EventStore.fs | 1 - src/Server/FeedCompositions.fs | 6 ------ src/Server/Server.fs | 1 - src/Server/UserCompositions.fs | 12 +++++------- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/Server/EventStore.fs b/src/Server/EventStore.fs index 194bce6..25892e1 100644 --- a/src/Server/EventStore.fs +++ b/src/Server/EventStore.fs @@ -3,7 +3,6 @@ namespace Castos open System open EventStore.ClientAPI -[] module EventStore = type StreamId = StreamId of string type StreamVersion = StreamVersion of int diff --git a/src/Server/FeedCompositions.fs b/src/Server/FeedCompositions.fs index efd1177..13ce295 100644 --- a/src/Server/FeedCompositions.fs +++ b/src/Server/FeedCompositions.fs @@ -45,12 +45,6 @@ module FeedCompositions = let private allFeedsEvents eventStore = allEventsFromStreamsStartsWith eventStore "feed-" - let private allFeedAddedEvents eventStore = - eventStore.GetEvents (StreamId("latest-feeds")) - - let private allEpisodeAddedEvents eventStore = - eventStore.GetEvents (StreamId("latest-feeds")) - let private getFeedStreamId id = sprintf "feed-%A" id diff --git a/src/Server/Server.fs b/src/Server/Server.fs index 8f44f3b..1fac145 100644 --- a/src/Server/Server.fs +++ b/src/Server/Server.fs @@ -7,7 +7,6 @@ open Microsoft.Extensions.Logging open Saturn open System.IO -open Castos.EventStore open Castos open Castos.Auth open Castos.SmapiCompositions diff --git a/src/Server/UserCompositions.fs b/src/Server/UserCompositions.fs index 9f652be..4ecfea0 100644 --- a/src/Server/UserCompositions.fs +++ b/src/Server/UserCompositions.fs @@ -17,7 +17,7 @@ type AddUserRendition = let private streamId = sprintf "users" -let private storeUsersEvent eventStore (version, event) = +let private storeUsersEvent eventStore event = storeEvent eventStore (fun _ -> streamId) event let getUsersComposition eventStore = @@ -30,12 +30,10 @@ let getUserComposition eventStore email = | Failure m -> fail m let addUserComposition eventStore (rendition:AddUserRendition) = - (StreamVersion 0, UserAdded { - Id = Guid.NewGuid() |> UserId - Email = rendition.EMail - Password = rendition.Password - //TODO: Hash and Salt - }) |> storeUsersEvent eventStore + UserAdded { Id = Guid.NewGuid() |> UserId + Email = rendition.EMail + Password = rendition.Password } //TODO: Hash and Salt + |> storeUsersEvent eventStore ok ("added user")