this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

:sparkles: created purge endpoint

+19 -1
+1 -1
request-get-all.hurl
··· 1 - GET http://localhost:9999/payments-summary 1 + GET http://localhost:8000/payments-summary?from=2020-07-10T12:34:56.000Z&to=2020-07-10T12:35:56.000Z
+5
src/redis.gleam
··· 48 48 conn 49 49 |> valkyrie.hgetall(default_key, default_timeout) 50 50 } 51 + 52 + pub fn delete_saved_data(conn: valkyrie.Connection) { 53 + conn 54 + |> valkyrie.del([default_key], default_timeout) 55 + }
+9
src/web/controllers/payment_controller.gleam
··· 77 77 |> wisp.json_body(string_tree.from_string("[]")) 78 78 } 79 79 } 80 + 81 + pub fn purge_payments( 82 + _req: wisp.Request, 83 + ctx: server.Context, 84 + ) -> response.Response(wisp.Body) { 85 + case redis.delete_saved_data(ctx.valkye_conn) { 86 + _ -> wisp.no_content() 87 + } 88 + }
+4
src/web/router.gleam
··· 16 16 use <- wisp.require_method(req, http.Get) 17 17 payment_controller.get_all_payments(req, ctx) 18 18 } 19 + ["purge-payments"] -> { 20 + use <- wisp.require_method(req, http.Post) 21 + payment_controller.purge_payments(req, ctx) 22 + } 19 23 _ -> wisp.not_found() 20 24 } 21 25 }