prop
prop
Explore posts from servers
DTDrizzle Team
Created by prop on 11/9/2023 in #help
Access values in "where" query
Hey, so I wan't to do some calculations, specifically geo radius. How can I access the data while doing the query?
const res = await db.query.apartments.findMany({
where: (apartment, { lte }) => {
const long = apartment.long
const lat = apartment.lat
return lte(lat, "15.053018297208397")
}
})
const res = await db.query.apartments.findMany({
where: (apartment, { lte }) => {
const long = apartment.long
const lat = apartment.lat
return lte(lat, "15.053018297208397")
}
})
Or how would I achieve this?
73 replies
TtRPC
Created by prop on 7/19/2023 in #❓-help
cookies not being set in procedure
This is all the code for setting my cookie
import { publicProcedure, router, userProcedure } from '$lib/trpc/t'

export const user = router({
testCookie: publicProcedure
.query(async ({ ctx: { cookies } }) => {
cookies.set("name", "value", {
path: '/'
})
})
})
import { publicProcedure, router, userProcedure } from '$lib/trpc/t'

export const user = router({
testCookie: publicProcedure
.query(async ({ ctx: { cookies } }) => {
cookies.set("name", "value", {
path: '/'
})
})
})
I'm using svelte-kit, but this doesn't set the cookie
8 replies