Skip to content

Commit b108c78

Browse files
committed
Apply lint
1 parent a51666e commit b108c78

File tree

5 files changed

+58
-54
lines changed

5 files changed

+58
-54
lines changed

apps/dumili/api/services/indexation/index.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,13 @@ const createAiStorySuggestions = async (
237237
if ("error" in results) {
238238
console.error(results.error);
239239
} else {
240-
let aiResultId =
241-
(
242-
await prisma.image.findUnique({
243-
where: {
244-
id: firstPageOfEntry.image.id,
245-
},
246-
})
247-
)?.[`${field}Id`];
240+
let aiResultId = (
241+
await prisma.image.findUnique({
242+
where: {
243+
id: firstPageOfEntry.image.id,
244+
},
245+
})
246+
)?.[`${field}Id`];
248247

249248
if (aiResultId) {
250249
if (field === "aiOcrResult") {

packages/api/http.ts

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createServer } from "http";
22
import { parse } from "url";
3+
34
import { prismaClient as prismaCoa } from "~prisma-schemas/schemas/coa/client";
45

56
import { getUpdateFileUrl } from "./services/app";
@@ -51,17 +52,17 @@ export default () =>
5152
issuenumber,
5253
},
5354
});
54-
const publishers = (
55-
await prismaCoa.inducks_publishingjob.findMany({
56-
select: {
57-
issuecode: true,
58-
publisherid: true,
59-
},
60-
where: {
61-
issuecode: issue.issuecode,
62-
},
63-
})
64-
).groupBy("issuecode", "publisherid[]");
55+
const publishers = (
56+
await prismaCoa.inducks_publishingjob.findMany({
57+
select: {
58+
issuecode: true,
59+
publisherid: true,
60+
},
61+
where: {
62+
issuecode: issue.issuecode,
63+
},
64+
})
65+
).groupBy("issuecode", "publisherid[]");
6566
const entriesList = await prismaCoa.inducks_entry.findMany({
6667
select: {
6768
entrycode: true,
@@ -105,10 +106,14 @@ export default () =>
105106
},
106107
},
107108
})
108-
).groupBy("storyversioncode", "[]", ({ personcode, plotwritartink }) => ({
109-
personcode,
110-
plotwritartink,
111-
}));
109+
).groupBy(
110+
"storyversioncode",
111+
"[]",
112+
({ personcode, plotwritartink }) => ({
113+
personcode,
114+
plotwritartink,
115+
}),
116+
);
112117

113118
const storyversionAppearances = (
114119
await prismaCoa.inducks_appearance.findMany({

packages/api/services/events/index.ts

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ import type {
2020
} from "~dm-types/events/EdgeCreationEvent";
2121
import type { MedalEvent } from "~dm-types/events/MedalEvent";
2222
import type { SignupEvent } from "~dm-types/events/SignupEvent";
23+
import MEDAL_LEVELS from "~dm-types/MedalLevels";
2324
import { prismaClient as prismaDm } from "~prisma-schemas/schemas/dm/client";
2425

2526
import namespaces from "../namespaces";
26-
import MEDAL_LEVELS from "~dm-types/MedalLevels";
2727

2828
const listenEvents = () => ({
2929
getEvents: () =>
3030
Promise.all([
31-
retrieveSignups(),
32-
retrieveCollectionUpdates(),
33-
retrieveCollectionSubscriptionAdditions(),
34-
retrieveBookstoreCreations(),
35-
retrieveEdgeCreations(),
36-
retrieveNewMedals(),
31+
retrieveSignups(),
32+
retrieveCollectionUpdates(),
33+
retrieveCollectionSubscriptionAdditions(),
34+
retrieveBookstoreCreations(),
35+
retrieveEdgeCreations(),
36+
retrieveNewMedals(),
3737
]).then((data) => data.flat()),
3838
});
3939

@@ -161,36 +161,36 @@ const retrieveNewMedals = async () =>
161161
(
162162
(
163163
await prismaDm.userContribution.findMany({
164-
select: {
165-
totalPoints: true,
166-
newPoints: true,
167-
userId: true,
168-
contribution: true,
169-
date: true,
170-
},
171-
where: {
172-
date: {
173-
gt: dayjs().subtract(1, "month").toDate(),
164+
select: {
165+
totalPoints: true,
166+
newPoints: true,
167+
userId: true,
168+
contribution: true,
169+
date: true,
170+
},
171+
where: {
172+
date: {
173+
gt: dayjs().subtract(1, "month").toDate(),
174+
},
174175
},
175-
},
176176
})
177-
)
177+
)
178178
.map(({ contribution, newPoints, totalPoints, userId, date }) => ({
179-
contribution: Object.keys(MEDALS_L10N_FR).find(
179+
contribution: Object.keys(MEDALS_L10N_FR).find(
180180
(medalType) => MEDALS_L10N_FR[medalType] === contribution,
181-
),
182-
userId,
183-
timestamp: dayjs(date).subtract(2, "hour").unix(),
184-
type: "medal",
181+
),
182+
userId,
183+
timestamp: dayjs(date).subtract(2, "hour").unix(),
184+
type: "medal",
185185
level:
186186
Object.entries(
187-
Object.entries(MEDAL_LEVELS).find(
187+
Object.entries(MEDAL_LEVELS).find(
188188
([medalType]) => contribution === MEDALS_L10N_FR[medalType],
189189
)![1],
190-
).find(
190+
).find(
191191
([, points]) =>
192192
totalPoints >= points && totalPoints - newPoints < points,
193-
)?.[0] || null,
193+
)?.[0] || null,
194194
}))
195-
.filter(({ level }) => level !== null) as AbstractEventRaw[]
196-
).map(mapUsers<MedalEvent>);
195+
.filter(({ level }) => level !== null) as AbstractEventRaw[]
196+
).map(mapUsers<MedalEvent>);

packages/types/MedalLevels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ export default {
22
edge_photographer: { 1: 50, 2: 150, 3: 600 },
33
edge_designer: { 1: 20, 2: 70, 3: 150 },
44
duckhunter: { 1: 1, 2: 3, 3: 8 },
5-
} as { [contribution: string]: { [level: number]: number } };
5+
} as { [contribution: string]: { [level: number]: number } };

util/group-by/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type GroupByValueType<
3030
type GroupByResultType<
3131
T,
3232
V extends null | "[]" | NestedKeyOf<T> | `${NestedKeyOf<T>}[]`,
33-
R
33+
R,
3434
> = [R] extends [never]
3535
? GroupByValueType<T, V>
3636
: V extends null

0 commit comments

Comments
 (0)