Skip to content

Commit abb766a

Browse files
authored
fix: format spaces with turbo expiration (#1011)
1 parent 6c78e66 commit abb766a

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/graphql/operations/ranking.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,15 @@ export default async function (_parent, args, context, info) {
8383
ORDER BY FIELD(s.id, ?) ASC
8484
`;
8585
let spaces = await db.queryAsync(query, [filteredSpaces, filteredSpaces]);
86-
spaces = spaces.map(space => Object.assign(space, formatSpace(space)));
86+
spaces = spaces.map(space =>
87+
Object.assign(
88+
space,
89+
formatSpace({
90+
turboExpiration: space.turbo_expiration,
91+
...space
92+
})
93+
)
94+
);
8795

8896
const items = await handleRelatedSpaces(info, spaces);
8997

src/graphql/operations/votes.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ async function query(parent, args, context?, info?) {
7070
let spaces = await db.queryAsync(query, [spaceIds]);
7171

7272
spaces = Object.fromEntries(
73-
spaces.map(space => [space.id, formatSpace(space)])
73+
spaces.map(space => [
74+
space.id,
75+
formatSpace({
76+
turboExpiration: space.turbo_expiration,
77+
...space
78+
})
79+
])
7480
);
7581
votes = votes.map(vote => {
7682
if (spaces[vote.space.id])

0 commit comments

Comments
 (0)