style: auto-fix lint and format
This commit is contained in:
1 parent
b902f93a3c
commit
db31f880c2
4 files changed
+32
-37
No files matched your search
@@ -4,14 +4,12 @@ import { createOneIntegrationMiddleware } from "../../middlewares/integration";
|
||||
import { createTRPCRouter, publicProcedure } from "../../trpc";
|
||||
|
||||
export const dawarichRouter = createTRPCRouter({
|
||||
getStatistics: publicProcedure
|
||||
.concat(createOneIntegrationMiddleware("query", "dawarich"))
|
||||
.query(async ({ ctx }) => {
|
||||
const { dawarichStatisticsRequestHandler } = await import("@homarr/request-handler/dawarich");
|
||||
const innerHandler = dawarichStatisticsRequestHandler.handler(ctx.integration, {});
|
||||
const data = await innerHandler.getCachedOrUpdatedDataAsync({ forceUpdate: false });
|
||||
return data.data;
|
||||
}),
|
||||
getStatistics: publicProcedure.concat(createOneIntegrationMiddleware("query", "dawarich")).query(async ({ ctx }) => {
|
||||
const { dawarichStatisticsRequestHandler } = await import("@homarr/request-handler/dawarich");
|
||||
const innerHandler = dawarichStatisticsRequestHandler.handler(ctx.integration, {});
|
||||
const data = await innerHandler.getCachedOrUpdatedDataAsync({ forceUpdate: false });
|
||||
return data.data;
|
||||
}),
|
||||
|
||||
getPlaces: publicProcedure
|
||||
.concat(createOneIntegrationMiddleware("query", "dawarich"))
|
||||
@@ -26,4 +24,4 @@ export const dawarichRouter = createTRPCRouter({
|
||||
const { data } = await innerHandler.getCachedOrUpdatedDataAsync({ forceUpdate: false });
|
||||
return data.slice(0, input.limit);
|
||||
}),
|
||||
});
|
||||
});
|
||||
@@ -1,31 +1,31 @@
|
||||
import {z} from "zod/v4";
|
||||
import { z } from "zod/v4";
|
||||
|
||||
export const dawarichStatisticsSchema = z.object({
|
||||
totalDistanceKm: z.number(),
|
||||
totalPointsTracked: z.number(),
|
||||
totalReverseGeocodedPoints: z.number(),
|
||||
totalCountriesVisited: z.number(),
|
||||
totalCitiesVisited: z.number()
|
||||
totalDistanceKm: z.number(),
|
||||
totalPointsTracked: z.number(),
|
||||
totalReverseGeocodedPoints: z.number(),
|
||||
totalCountriesVisited: z.number(),
|
||||
totalCitiesVisited: z.number(),
|
||||
});
|
||||
|
||||
export const dawarichPlaceTagSchema = z.object({
|
||||
id: z.number(),
|
||||
name: z.string(),
|
||||
icon: z.string(),
|
||||
color: z.string()
|
||||
id: z.number(),
|
||||
name: z.string(),
|
||||
icon: z.string(),
|
||||
color: z.string(),
|
||||
});
|
||||
|
||||
export const dawarichPlaceSchema = z.object({
|
||||
id: z.number(),
|
||||
name: z.string(),
|
||||
latitude: z.number(),
|
||||
longitude: z.number(),
|
||||
source: z.string().optional(),
|
||||
icon: z.string().nullable(),
|
||||
color: z.string().nullable(),
|
||||
visits_count: z.number(),
|
||||
created_at: z.string(),
|
||||
tags: z.array(dawarichPlaceTagSchema)
|
||||
id: z.number(),
|
||||
name: z.string(),
|
||||
latitude: z.number(),
|
||||
longitude: z.number(),
|
||||
source: z.string().optional(),
|
||||
icon: z.string().nullable(),
|
||||
color: z.string().nullable(),
|
||||
visits_count: z.number(),
|
||||
created_at: z.string(),
|
||||
tags: z.array(dawarichPlaceTagSchema),
|
||||
});
|
||||
|
||||
export const dawarichPlacesSchema = z.array(dawarichPlaceSchema);
|
||||
export const dawarichPlacesSchema = z.array(dawarichPlaceSchema);
|
||||
@@ -1,5 +1,5 @@
|
||||
import { z } from "zod/v4";
|
||||
import { dawarichPlacesSchema, dawarichStatisticsSchema } from "./dawarich-schemas";
|
||||
import type { z } from "zod/v4";
|
||||
import type { dawarichPlacesSchema, dawarichStatisticsSchema } from "./dawarich-schemas";
|
||||
|
||||
export type DawarichStatistics = z.infer<typeof dawarichStatisticsSchema>;
|
||||
export type DawarichPlace = z.infer<typeof dawarichPlacesSchema>[number];
|
||||
export type DawarichPlace = z.infer<typeof dawarichPlacesSchema>[number];
|
||||
@@ -10,10 +10,7 @@ import { WidgetEmptyState } from "../common/empty-state";
|
||||
import type { WidgetComponentProps } from "../definition";
|
||||
import classes from "./component.module.css";
|
||||
|
||||
export default function DawarichPlacesWidget({
|
||||
integrationIds,
|
||||
options,
|
||||
}: WidgetComponentProps<"dawarichPlaces">) {
|
||||
export default function DawarichPlacesWidget({ integrationIds, options }: WidgetComponentProps<"dawarichPlaces">) {
|
||||
const t = useI18n();
|
||||
const { data: places } = clientApi.widget.dawarich.getPlaces.useQuery(
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user