fix: removed user_ids from create list payload; improved share button on invites
This commit is contained in:
@@ -162,14 +162,13 @@ describe('useListsStore', () => {
|
||||
listsApiMocks.getListsApi.mockResolvedValueOnce([{ id: 'server-id-1', name: 'Groceries' }])
|
||||
|
||||
const store = useListsStore()
|
||||
const localList = await store.createList('Groceries', [])
|
||||
const localList = await store.createList('Groceries')
|
||||
|
||||
// wait for the fire-and-forget sync triggered by createList to settle
|
||||
await store.sync()
|
||||
|
||||
expect(listsApiMocks.createListApi).toHaveBeenCalledWith({
|
||||
name: 'Groceries',
|
||||
user_ids: [],
|
||||
})
|
||||
expect(store.lists.find((list) => list.id === localList.id)).toBeUndefined()
|
||||
const synced = store.lists.find((list) => list.id === 'server-id-1')
|
||||
|
||||
+2
-2
@@ -134,7 +134,7 @@ export const useListsStore = defineStore('lists', () => {
|
||||
}, SYNC_DEBOUNCE_MS)
|
||||
}
|
||||
|
||||
async function createList(name: string, userIds: string[] = []): Promise<LocalList> {
|
||||
async function createList(name: string): Promise<LocalList> {
|
||||
const now = new Date().toISOString()
|
||||
const localList: LocalList = {
|
||||
id: generateId(),
|
||||
@@ -148,7 +148,7 @@ export const useListsStore = defineStore('lists', () => {
|
||||
upsertList(localList)
|
||||
await enqueue({
|
||||
type: 'createList',
|
||||
payload: { name, user_ids: userIds },
|
||||
payload: { name },
|
||||
localListId: localList.id,
|
||||
})
|
||||
scheduleSync()
|
||||
|
||||
Reference in New Issue
Block a user