mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 17:11:17 +00:00
feat(backend): add WeatherService
Manage per-user WeatherSource instances via FeedSourceProvider, following the same pattern as LocationService. Wire into FeedEngineService so weather data is included in the feed. Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { TRPCError } from "@trpc/server"
|
||||
import { type } from "arktype"
|
||||
|
||||
import { UserNotFoundError } from "../lib/error.ts"
|
||||
import type { TRPC } from "../trpc/router.ts"
|
||||
import type { LocationService } from "./service.ts"
|
||||
|
||||
import { UserNotFoundError } from "../lib/error.ts"
|
||||
|
||||
const locationInput = type({
|
||||
lat: "number",
|
||||
lng: "number",
|
||||
@@ -12,7 +13,10 @@ const locationInput = type({
|
||||
timestamp: "Date",
|
||||
})
|
||||
|
||||
export function createLocationRouter(t: TRPC, { locationService }: { locationService: LocationService }) {
|
||||
export function createLocationRouter(
|
||||
t: TRPC,
|
||||
{ locationService }: { locationService: LocationService },
|
||||
) {
|
||||
return t.router({
|
||||
update: t.procedure.input(locationInput).mutation(({ input, ctx }) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user