fix: mdoels

This commit is contained in:
orion 2023-11-27 15:59:54 -06:00
parent d4b937d0f6
commit cfd23aa00b
Signed by: orion
GPG Key ID: 6D4165AE4C928719
3 changed files with 16 additions and 6 deletions

View File

@ -7,6 +7,7 @@ package:
- exceptions
- fetch
- foreign-object
- maybe
- mmorph
- newtype
- node-buffer
@ -52,7 +53,7 @@ workspace:
- url
url:
git: 'https://git.orionkindel.com/thunderstrike/purescript-url-immutable.git'
ref: 'dbfa3b6'
ref: '555d55a'
dependencies:
- arrays
- effect

View File

@ -3,6 +3,8 @@ module Gitea.Error where
import Prelude
import Control.Monad.Error.Class (class MonadThrow, throwError)
import Data.Generic.Rep (class Generic)
import Data.Show.Generic (genericShow)
import Effect.Aff.Class (class MonadAff)
import HTTP.Response as HTTP
import HTTP.Response as HTTP.Rep
@ -13,6 +15,12 @@ data Error
| ENotFound
| EValidation { message :: String, url :: String }
derive instance Generic Error _
instance Show Error where
show = genericShow
derive instance Eq Error
guardStatusOk :: forall m. MonadThrow Error m => MonadAff m => HTTP.Response -> m Unit
guardStatusOk rep = do
status <- HTTP.Rep.status rep

View File

@ -2,6 +2,7 @@ module Gitea.Types where
import Prelude
import Data.Maybe (Maybe)
import Data.Newtype (class Newtype)
import Foreign.Object (Object)
import Simple.JSON (class ReadForeign, class WriteForeign)
@ -267,7 +268,7 @@ type RepoGiteaSettingsMutable r =
type RepoSectionGiteaStatsMutable r =
( "template" :: Boolean
, "external_wiki" :: RepoExternalWiki
, "external_wiki" :: Maybe RepoExternalWiki
| r
)
@ -280,7 +281,7 @@ type RepoSectionGiteaStatsImmutable r =
, "watchers_count" :: Int
, "fork" :: Boolean
, "forks_count" :: Int
, "repo_transfer" :: RepoTransfer
, "repo_transfer" :: Maybe RepoTransfer
| r
)
@ -311,8 +312,8 @@ type RepoSectionStatsImmutable r =
)
type RepoSectionTrackerMutable r =
( "external_tracker" :: RepoExternalTracker
, "internal_tracker" :: RepoInternalTracker
( "external_tracker" :: Maybe RepoExternalTracker
, "internal_tracker" :: Maybe RepoInternalTracker
| r
)
@ -370,7 +371,7 @@ type Commit =
, "removed" :: Array String
, "timestamp" :: String
, "url" :: String
, "verification" :: CommitVerification
, "verification" :: Maybe CommitVerification
}
type Branch =