feat(api): Use js.UndefOr for defaultServiceId (#980)

Use js.UndefOr
This commit is contained in:
InversionSpaces 2023-11-22 14:44:34 +01:00 committed by GitHub
parent 3472f2016f
commit 1e525fad35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -44,9 +44,10 @@ jobs:
fcli: fcli:
needs: aqua needs: aqua
uses: fluencelabs/cli/.github/workflows/tests.yml@main uses: fluencelabs/fluence-cli/.github/workflows/tests.yml@use-js-client-0.5.0
with: with:
aqua-snapshots: "${{ needs.aqua.outputs.aqua-snapshots }}" aqua-snapshots: "${{ needs.aqua.outputs.aqua-snapshots }}"
ref: use-js-client-0.5.0
registry: registry:
needs: needs:

View File

@ -115,14 +115,17 @@ object TypeDefinitionJs {
@JSExportAll @JSExportAll
case class ServiceDefJs( case class ServiceDefJs(
defaultServiceId: Option[String], defaultServiceId: js.UndefOr[String],
functions: LabeledTypeDefJs functions: LabeledTypeDefJs
) )
object ServiceDefJs { object ServiceDefJs {
def apply(sd: ServiceDef): ServiceDefJs = { def apply(sd: ServiceDef): ServiceDefJs = {
ServiceDefJs(sd.defaultServiceId, LabeledTypeDefJs(sd.functions)) ServiceDefJs(
sd.defaultServiceId.getOrElse(()),
LabeledTypeDefJs(sd.functions)
)
} }
} }