Skip to content

Commit

Permalink
removed autoopen for eventstore
Browse files Browse the repository at this point in the history
  • Loading branch information
brase committed Feb 17, 2020
1 parent 4ac87fc commit 27b7a05
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/Server/EventStore.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ namespace Castos
open System
open EventStore.ClientAPI

[<AutoOpen>]
module EventStore =
type StreamId = StreamId of string
type StreamVersion = StreamVersion of int
Expand Down
6 changes: 0 additions & 6 deletions src/Server/FeedCompositions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion src/Server/Server.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ open Microsoft.Extensions.Logging
open Saturn
open System.IO

open Castos.EventStore
open Castos
open Castos.Auth
open Castos.SmapiCompositions
Expand Down
12 changes: 5 additions & 7 deletions src/Server/UserCompositions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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")

Expand Down

0 comments on commit 27b7a05

Please sign in to comment.