style: Prettier format
This commit is contained in:
parent
016813dd56
commit
ac93c0ca4b
@ -34,7 +34,6 @@ async function getMessages(client: cassandra.Client, channelName: string, limit:
|
|||||||
// to be specified by EQ or IN when using ORDER BY
|
// to be specified by EQ or IN when using ORDER BY
|
||||||
res.rows.sort((a, b) => a.timestamp - b.timestamp);
|
res.rows.sort((a, b) => a.timestamp - b.timestamp);
|
||||||
|
|
||||||
|
|
||||||
// For the same reason as above, we have to apply the limit manually
|
// For the same reason as above, we have to apply the limit manually
|
||||||
// as well, because if we only query 5, but they're not properly sorted,
|
// as well, because if we only query 5, but they're not properly sorted,
|
||||||
// it will only return the first 5 instead of the last 5
|
// it will only return the first 5 instead of the last 5
|
||||||
|
@ -6,7 +6,11 @@ export const load: PageLoad = async () => {
|
|||||||
const rows = await getMessages(client, '000', 5);
|
const rows = await getMessages(client, '000', 5);
|
||||||
const messages: TypeMessage[] = rows
|
const messages: TypeMessage[] = rows
|
||||||
? rows.map((value) => {
|
? rows.map((value) => {
|
||||||
return { message: value.message_content, user: value.sender.toString(), imageSrc: `https://api.dicebear.com/9.x/identicon/svg?seed=${value.sender.toString()}` };
|
return {
|
||||||
|
message: value.message_content,
|
||||||
|
user: value.sender.toString(),
|
||||||
|
imageSrc: `https://api.dicebear.com/9.x/identicon/svg?seed=${value.sender.toString()}`,
|
||||||
|
};
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user