Skip to content

Commit

Permalink
Turn those to shareds
Browse files Browse the repository at this point in the history
  • Loading branch information
strawmelonjuice committed Dec 3, 2024
1 parent e8d4c48 commit b0190b8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 4 additions & 8 deletions backend/src/lumina/web/routing/api_fe.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import gleam/string
import gleam/string_builder
import lumina/data/context.{type Context}
import lumina/shared/shared_fejsonobject
import lumina/shared/shared_fepage_com.{
type FEPageServeRequest, type FEPageServeResponse, FEPageServeRequest,
FEPageServeResponse,
}
import lumina/shared/shared_users
import lumina/users
import lumina/web/pages
Expand Down Expand Up @@ -224,14 +228,6 @@ pub fn create_user(req: wisp.Request, ctx: context.Context) {
}
}

type FEPageServeRequest {
FEPageServeRequest(location: String)
}

type FEPageServeResponse {
FEPageServeResponse(main: String, side: String, message: List(Int))
}

pub fn pagesrverresponder(req: wisp.Request, ctx: context.Context) {
let pagesrverresponseencoder = fn(response: FEPageServeResponse) {
json.object([
Expand Down
12 changes: 12 additions & 0 deletions shared/src/lumina/shared/shared_fepage_com.gleam
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) 2024, MLC 'Strawmelonjuice' Bloeiman
// Licensed under the BSD 3-Clause License. See the LICENSE file for more info.

/// A request from the client to the server to serve a page.
pub type FEPageServeRequest {
FEPageServeRequest(location: String)
}

/// A response from the server to a request to serve a page.
pub type FEPageServeResponse {
FEPageServeResponse(main: String, side: String, message: List(Int))
}

0 comments on commit b0190b8

Please sign in to comment.