mirror of
https://github.com/suitenumerique/docs
synced 2026-04-21 13:37:20 +00:00
🏷️(frontend) adapt thread new type
We stopped to use pagination for thread comments, so we need to adapt the thread type to reflect that.
This commit is contained in:
parent
9a1dae4908
commit
c58deb11e8
2 changed files with 4 additions and 3 deletions
|
|
@ -142,6 +142,7 @@ test.describe('Doc Version', () => {
|
|||
const thread = page.locator('.bn-thread');
|
||||
await thread.getByRole('paragraph').first().fill('This is a comment');
|
||||
await thread.locator('[data-test="save"]').click();
|
||||
await expect(thread).toBeHidden();
|
||||
|
||||
await goToGridDoc(page, {
|
||||
title: randomDoc,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { CommentBody, ThreadStore } from '@blocknote/core/comments';
|
||||
import type { Awareness } from 'y-protocols/awareness';
|
||||
|
||||
import { APIError, APIList, errorCauses, fetchAPI } from '@/api';
|
||||
import { APIError, errorCauses, fetchAPI } from '@/api';
|
||||
import { Doc } from '@/features/docs/doc-management';
|
||||
|
||||
import { useEditorStore } from '../../stores';
|
||||
|
|
@ -15,7 +15,7 @@ import {
|
|||
ServerThread,
|
||||
} from './types';
|
||||
|
||||
type ServerThreadListResponse = APIList<ServerThread>;
|
||||
type ServerThreadListResponse = ServerThread[];
|
||||
|
||||
export class DocsThreadStore extends ThreadStore {
|
||||
protected static COMMENTS_PING = 'commentsPing';
|
||||
|
|
@ -335,7 +335,7 @@ export class DocsThreadStore extends ThreadStore {
|
|||
|
||||
const threads = (await response.json()) as ServerThreadListResponse;
|
||||
const next = new Map<string, ClientThreadData>();
|
||||
threads.results.forEach((thread) => {
|
||||
threads.forEach((thread) => {
|
||||
const threadData: ClientThreadData = serverThreadToClientThread(thread);
|
||||
next.set(thread.id, threadData);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue