mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
Working on dnd
This commit is contained in:
@@ -6,7 +6,7 @@ export default defineCachedEventHandler(async (event) => {
|
||||
const query = getQuery(event)
|
||||
|
||||
if (Number(query.lon) === Infinity || Number(query.lat) === Infinity) {
|
||||
return createError('Invalid coordinates')
|
||||
return sendNoContent(event, 500)
|
||||
}
|
||||
|
||||
const openWeather = await $fetch<OpenWeatherType>('https://api.openweathermap.org/data/2.5/weather', {
|
||||
@@ -34,6 +34,6 @@ export default defineCachedEventHandler(async (event) => {
|
||||
wind: openWeather.wind.speed,
|
||||
} as WeatherType
|
||||
}, {
|
||||
maxAge: 60 * 60 * 3,
|
||||
maxAge: 1,
|
||||
name: 'weather',
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core'
|
||||
import { relations } from 'drizzle-orm'
|
||||
import { id, timestamps } from '../utils/dbFields'
|
||||
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core'
|
||||
import { Subscription } from '../../types/types'
|
||||
import { id, timestamps } from '../utils/dbFields'
|
||||
|
||||
export const users = sqliteTable('users', {
|
||||
id,
|
||||
@@ -17,7 +17,7 @@ export const users = sqliteTable('users', {
|
||||
private: integer('private', { mode: 'boolean' }).default(false),
|
||||
language: text('language').default('en-EN'),
|
||||
location: text('location').default('unknown'),
|
||||
weatherTab: integer('weather_tab', { mode: 'boolean' }).default(0),
|
||||
weatherTab: integer('weather_tab', { mode: 'boolean' }).default(false),
|
||||
subscription: text('subscription', { enum: Subscription }).default('free'),
|
||||
...timestamps,
|
||||
})
|
||||
@@ -28,6 +28,7 @@ export const categories = sqliteTable('categories', {
|
||||
nameVisible: integer('name_visible', { mode: 'boolean' }).default(true),
|
||||
icon: text('icon').default('i-ph:circle-wavy-question-duotone'),
|
||||
color: text('color').default('gray'),
|
||||
grid: text('grid', { mode: 'json' }).default(''),
|
||||
userId: integer('user_id')
|
||||
.notNull()
|
||||
.references(() => users.id, { onDelete: 'cascade' }),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { drizzle } from 'drizzle-orm/d1'
|
||||
import * as schema from '../database/schema'
|
||||
|
||||
export { sql, eq, and, or, asc, desc, sum, isNull } from 'drizzle-orm'
|
||||
export { and, asc, desc, eq, isNull, or, sql, sum } from 'drizzle-orm'
|
||||
|
||||
export const tables = schema
|
||||
|
||||
|
||||
Reference in New Issue
Block a user