diff --git a/src/components/Inbox/Message.tsx b/src/components/Inbox/Message.tsx index 2e35c071..1cd5a65c 100644 --- a/src/components/Inbox/Message.tsx +++ b/src/components/Inbox/Message.tsx @@ -19,8 +19,8 @@ type Props = { export const Message = (props: Props) => { const { formatTime } = useLocalize() - const isOwn = props.ownId === Number(props.content.author) - const user = props.members?.find((m) => m.id === Number(props.content.author)) + const isOwn = props.ownId === Number(props.content.created_by) + const user = props.members?.find((m) => m.id === Number(props.content.created_by)) const [isPopupVisible, setIsPopupVisible] = createSignal(false) return ( @@ -48,7 +48,7 @@ export const Message = (props: Props) => {
-
{formatTime(new Date(props.content.createdAt * 1000))}
+
{formatTime(new Date(props.content.created_at * 1000))}
) } diff --git a/src/components/Views/Expo/Expo.tsx b/src/components/Views/Expo/Expo.tsx index 1deab51e..1e5b3631 100644 --- a/src/components/Views/Expo/Expo.tsx +++ b/src/components/Views/Expo/Expo.tsx @@ -37,7 +37,7 @@ export const Expo = (props: Props) => { offset: sortedArticles().length } - options.filters = getLayout() ? { layout: getLayout() } : { excludeLayout: 'article' } + options.filters = getLayout() ? { layout: getLayout() } : { exclude_layout: 'article' } const { hasMore } = await loadShouts(options) setIsLoadMoreButtonVisible(hasMore) diff --git a/src/context/inbox.tsx b/src/context/inbox.tsx index e90dcbc3..ae916a66 100644 --- a/src/context/inbox.tsx +++ b/src/context/inbox.tsx @@ -70,7 +70,7 @@ export const InboxProvider = (props: { children: JSX.Element }) => { try { const message = await inboxClient.createMessage(args) setMessages((prev) => [...prev, message]) - const currentChat = chats().find((chat) => chat.id === args.chat) + const currentChat = chats().find((chat) => chat.id === args.chat_id) setChats((prev) => [ ...prev.filter((c) => c.id !== currentChat.id), { ...currentChat, updatedAt: message.createdAt } diff --git a/src/context/notifications.tsx b/src/context/notifications.tsx index c7e28da2..cebdfc70 100644 --- a/src/context/notifications.tsx +++ b/src/context/notifications.tsx @@ -104,11 +104,10 @@ export const NotificationsProvider = (props: { children: JSX.Element }) => { }, onmessage(event) { const m: SSEMessage = JSON.parse(event.data) + console.log('[context.notifications] Received message:', m) if (m.entity === 'chat' || m.entity == 'message') { - console.log('[context.notifications] Received message:', m) messageHandler()(m) } else { - console.log('[context.notifications] Received notification:', m) storeNotification({ ...m, id: event.id, diff --git a/src/graphql/mutation/chat-message-create.ts b/src/graphql/mutation/chat-message-create.ts index 48152d4e..480f2671 100644 --- a/src/graphql/mutation/chat-message-create.ts +++ b/src/graphql/mutation/chat-message-create.ts @@ -7,7 +7,7 @@ export default gql` message { id body - author + created_by created_at reply_to updated_at diff --git a/src/graphql/mutation/chat-message-update.ts b/src/graphql/mutation/chat-message-update.ts index 4cfbb79a..fb91bb6f 100644 --- a/src/graphql/mutation/chat-message-update.ts +++ b/src/graphql/mutation/chat-message-update.ts @@ -8,7 +8,7 @@ export default gql` message { id body - author + created_by created_at reply_to updated_at diff --git a/src/graphql/query/chat-messages-load-by.ts b/src/graphql/query/chat-messages-load-by.ts index d4567d60..c0934055 100644 --- a/src/graphql/query/chat-messages-load-by.ts +++ b/src/graphql/query/chat-messages-load-by.ts @@ -6,7 +6,7 @@ export default gql` error messages { id - author + created_by body reply_to created_at diff --git a/src/graphql/types.gen.ts b/src/graphql/types.gen.ts index 7e30a9d0..54a3f234 100644 --- a/src/graphql/types.gen.ts +++ b/src/graphql/types.gen.ts @@ -128,7 +128,7 @@ export type LoadShoutsFilters = { author?: InputMaybe body?: InputMaybe days?: InputMaybe - excludeLayout?: InputMaybe + exclude_layout?: InputMaybe layout?: InputMaybe reacted?: InputMaybe title?: InputMaybe @@ -146,7 +146,7 @@ export type LoadShoutsOptions = { } export type Message = { - author: Scalars['Int']['output'] + created_by: Scalars['Int']['output'] body: Scalars['String']['output'] chat_id: Scalars['String']['output'] created_at: Scalars['Int']['output'] @@ -163,7 +163,7 @@ export enum MessageStatus { } export type MessagesBy = { - author?: InputMaybe + created_by?: InputMaybe body?: InputMaybe chat?: InputMaybe days?: InputMaybe @@ -635,7 +635,6 @@ export type ShoutInput = { description?: InputMaybe layout?: InputMaybe lead?: InputMaybe - mainTopic?: InputMaybe media?: InputMaybe slug?: InputMaybe subtitle?: InputMaybe diff --git a/src/pages/expo/expo.page.server.ts b/src/pages/expo/expo.page.server.ts index 0d360c5a..8523f65c 100644 --- a/src/pages/expo/expo.page.server.ts +++ b/src/pages/expo/expo.page.server.ts @@ -5,7 +5,7 @@ import { PRERENDERED_ARTICLES_COUNT } from '../../components/Views/Expo/Expo' export const onBeforeRender = async (_pageContext: PageContext) => { const expoShouts = await apiClient.getShouts({ - filters: { excludeLayout: 'article' }, + filters: { exclude_layout: 'article' }, limit: PRERENDERED_ARTICLES_COUNT }) const pageProps: PageProps = { expoShouts }