remove unused API stub from CLI
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE ViewPatterns #-}
|
||||
|
||||
module API.Collection where
|
||||
|
||||
import Data.Aeson qualified as A
|
||||
import Data.Aeson.KeyMap qualified as AM
|
||||
import Data.Text qualified as T
|
||||
import Process.Shell (Quotable (..), sh)
|
||||
import Debug.Trace
|
||||
|
||||
insert :: T.Text -> T.Text -> A.Object -> IO T.Text
|
||||
insert
|
||||
collectionName
|
||||
fileName
|
||||
( traceShowId -> AM.insert "$fileName" (A.String fileName) -> traceShowId ->
|
||||
A.Object -> traceShowId -> contents
|
||||
) =
|
||||
{- TODO REST/ CRUD API
|
||||
[sh|
|
||||
curl -fsS http://localhost:8081/collections/#{collectionName}/#{filePath} \
|
||||
--data #{contents}
|
||||
\|]-}
|
||||
[sh|
|
||||
set -efux
|
||||
curl -fsS http://localhost:8081 \
|
||||
--data "INSERT "'#{contents}'" INTO #{collectionName}"
|
||||
|]
|
||||
|
||||
-- TODO sh
|
||||
instance Quotable A.Value where
|
||||
toString = toString . A.encode
|
||||
@@ -11,7 +11,7 @@ extra-doc-files: CHANGELOG.md
|
||||
executable cli
|
||||
main-is: Main.hs
|
||||
hs-source-dirs: app
|
||||
other-modules: API.Collection
|
||||
other-modules:
|
||||
default-language: GHC2021
|
||||
ghc-options: -Wall
|
||||
build-depends:
|
||||
|
||||
Reference in New Issue
Block a user