Timo Martinson
Timo Martinson
Explore posts from servers
DDeno
Created by Timo Martinson on 3/3/2024 in #help
How to start using data validation in kv?
type Post = {
title: string
slug: string
content: string
draft: boolean
publishedAt: Date
}
type Post = {
title: string
slug: string
content: string
draft: boolean
publishedAt: Date
}
6 replies
DDeno
Created by Timo Martinson on 3/3/2024 in #help
How to start using data validation in kv?
This is my model:
6 replies
DDeno
Created by Timo Martinson on 8/21/2023 in #help
Property 'params' does not exist on type 'Context<State, Record<string, any>> ... what to do?
this is my controller action:
class CityController {
async createCity(context: Context) {
const { citySlug } = context.params
const key = ['cities', citySlug]
const result = await kv.atomic().check({ key, versionstamp: null }).set(key, value).commit()
}
...
}
class CityController {
async createCity(context: Context) {
const { citySlug } = context.params
const key = ['cities', citySlug]
const result = await kv.atomic().check({ key, versionstamp: null }).set(key, value).commit()
}
...
}
3 replies
DDeno
Created by Timo Martinson on 7/22/2023 in #help
Where to store this key — and how?
I want to use it with JWTs
5 replies
DDeno
Created by Timo Martinson on 7/22/2023 in #help
Typing DateTimes
can't I use simple "string"-dates ?
7 replies
DDeno
Created by Timo Martinson on 7/22/2023 in #help
Typing DateTimes
or what format should a Date have?
7 replies
DDeno
Created by Timo Martinson on 7/4/2023 in #help
Absolute Imports with Oak
😉
5 replies
DDeno
Created by Timo Martinson on 7/4/2023 in #help
Absolute Imports with Oak
maybe
5 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
ok now it works
24 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
GET works, POST doesn't
24 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
ssooooooo...
24 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
silly me
24 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
😦
24 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
i forgot
24 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
thank you
24 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
yes
24 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
oh
24 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
// List Cities
router.get('/cities', async () => {
const list = kv.list<ICity[]>({ prefix: ['cities'] })
const cities = []
for await (const city of list) cities.push(city)
return { data: { cities } }
})
// List Cities
router.get('/cities', async () => {
const list = kv.list<ICity[]>({ prefix: ['cities'] })
const cities = []
for await (const city of list) cities.push(city)
return { data: { cities } }
})
24 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
and when i make a get-request: 404 not found
24 replies
DDeno
Created by Timo Martinson on 7/20/2023 in #help
KV: What to return from here?
😦
24 replies