fix: removed user_ids from create list payload; improved share button on invites

This commit is contained in:
2026-09-01 15:29:31 +02:00
parent 3998679810
commit 6196556012
6 changed files with 46 additions and 8 deletions
+1 -2
View File
@@ -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
View File
@@ -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()