Yashvardhan
Yashvardhan
WWasp-lang
Created by Yashvardhan on 3/28/2024 in #đŸ™‹questions
How can I get current theme colors and set them to div ?
No description
14 replies
WWasp-lang
Created by Yashvardhan on 3/28/2024 in #đŸ™‹questions
How can I get current theme colors and set them to div ?
Is it okay If I do this ?
14 replies
WWasp-lang
Created by Yashvardhan on 3/28/2024 in #đŸ™‹questions
How can I get current theme colors and set them to div ?
I got your point of keeping business logic separate and call it from API and Operations implementation. Something like this :
api generateTextToTextResponse {
fn: import { generateTextToTextResponse } from "@src/server/actions.js",
entities: [User],
httpRoute: (POST, "/generate-text-to-text-response")
}

action generateTextToTextResponse {
fn: import { generateTextToTextResponse } from "@src/server/actions.js",
entities: [User]
}
api generateTextToTextResponse {
fn: import { generateTextToTextResponse } from "@src/server/actions.js",
entities: [User],
httpRoute: (POST, "/generate-text-to-text-response")
}

action generateTextToTextResponse {
fn: import { generateTextToTextResponse } from "@src/server/actions.js",
entities: [User]
}
actions.js
export const generateTextToTextResponse: GenerateTextToTextResponse<TextToTextPayload, TextToTextResponse> = async ({ user_prompt }, context) => {
// business logic
// can be used in wasp client
// and can also to exposed to http endpoint
}
export const generateTextToTextResponse: GenerateTextToTextResponse<TextToTextPayload, TextToTextResponse> = async ({ user_prompt }, context) => {
// business logic
// can be used in wasp client
// and can also to exposed to http endpoint
}
14 replies
WWasp-lang
Created by Yashvardhan on 3/28/2024 in #đŸ™‹questions
How can I get current theme colors and set them to div ?
yes, this is what I want
14 replies
WWasp-lang
Created by Yashvardhan on 3/28/2024 in #đŸ™‹questions
How can I get current theme colors and set them to div ?
context.user
context.user
only exists if it is called from client, to expose it I need to use headers for token.
14 replies
WWasp-lang
Created by Yashvardhan on 3/28/2024 in #đŸ™‹questions
How can I get current theme colors and set them to div ?
No description
14 replies