Skip to content

Commit

Permalink
More scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
blair55 committed Dec 29, 2022
1 parent 7535b54 commit 68434a2
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 11 deletions.
12 changes: 12 additions & 0 deletions http/bulkRemove.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#r "nuget: FSharp.Data"

open System.Text.Json
open FSharp.Data
open FSharp.Data.HttpContentTypes
open FSharp.Data.HttpRequestHeaders

[ "" ]
|> List.map (fun s -> JsonSerializer.Serialize({| PlayerId = s |}))
|> List.iter (fun r ->
Http.Request("https://rightresu.lt/api/removePlayer", body = TextRequest r, headers = [ ContentType Json ])
|> ignore)
59 changes: 59 additions & 0 deletions http/put-predictions.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
POST https://rightresu.lt/api/putPredictions
content-type: application/json

{
"PlayerId": "",
"FixtureSetId": "",
"Predictions": [
{
"FixtureId": "",
"HomeScore": int,
"AwayScore": int
},
{
"FixtureId": "",
"HomeScore": int,
"AwayScore": int
},
{
"FixtureId": "",
"HomeScore": int,
"AwayScore": int
},
{
"FixtureId": "",
"HomeScore": int,
"AwayScore": int
},
{
"FixtureId": "",
"HomeScore": int,
"AwayScore": int
},
{
"FixtureId": "",
"HomeScore": int,
"AwayScore": int
},
{
"FixtureId": "",
"HomeScore": int,
"AwayScore": int
},
{
"FixtureId": "",
"HomeScore": int,
"AwayScore": int
},
{
"FixtureId": "",
"HomeScore": int,
"AwayScore": int
},
{
"FixtureId": "",
"HomeScore": int,
"AwayScore": int
},
]
}
7 changes: 0 additions & 7 deletions http/remove-player-from-league copy.http

This file was deleted.

7 changes: 7 additions & 0 deletions http/remove-player-from-league.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
POST https://rightresu.lt/api/removePlayerFromLeague
content-type: application/json

{
"PlayerId": "",
"LeagueId": "",
}
6 changes: 6 additions & 0 deletions http/remove-player.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
POST https://rightresu.lt/api/removePlayer
content-type: application/json

{
"PlayerId": "",
}
8 changes: 4 additions & 4 deletions src/Server/EventHandling.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ open Server.Subscribers
module EventHandling =

let (|MapPredictionSetEventPlayerIdId|) (PlayerId playerId) : PlayerId =
PlayerId playerId
// if "fb-735238821018" = playerId
// then PlayerId "tw-458540585"
// else PlayerId playerId
match playerId with
| "fb-10160345161488703" -> PlayerId "tw-414832159"
| "fb-735238821018" -> PlayerId "tw-458540585"
| _ -> PlayerId playerId

let onEvent deps (DatedEvent (event, created)) =
printfn "handling event: %A" event
Expand Down

0 comments on commit 68434a2

Please sign in to comment.