Revize 88d2df9a
Přidáno uživatelem Fantič před téměř 2 roky(ů)
src/stores/actions/itemThunks.ts | ||
---|---|---|
11 | 11 |
|
12 | 12 |
console.log("¨GET item/getItem/" + itemId); |
13 | 13 |
|
14 |
const response = await getItemRequest(itemId) |
|
14 |
const response = await getItemRequest(itemId);
|
|
15 | 15 |
|
16 | 16 |
|
17 | 17 |
// data with image |
... | ... | |
57 | 57 |
inventoryItem: response.data.text, |
58 | 58 |
searchSubjects: response.data.search_subject, |
59 | 59 |
} |
60 |
} { |
|
60 |
} |
|
61 |
else { |
|
61 | 62 |
return Promise.reject(response.data ? response.data : "Error") |
62 | 63 |
} |
63 | 64 |
} catch (err: any) { |
... | ... | |
107 | 108 |
"item/getItemNotes", |
108 | 109 |
async (itemId: string) => { |
109 | 110 |
try { |
110 |
const response = await getItemNotesRequest(itemId) |
|
111 |
console.log(response) |
|
111 |
console.log("¨GET notes/getNotes/" + itemId); |
|
112 |
|
|
113 |
const response = await getItemNotesRequest(itemId); |
|
114 |
|
|
112 | 115 |
if (response.status === 200) { |
113 |
return { |
|
114 |
// TODO set item notes |
|
116 |
if(response.data.length > 0){ |
|
117 |
|
|
118 |
let notes = []; |
|
119 |
for(let i = 0; i < response.data.length; i++){ |
|
120 |
let note = response.data[i]; |
|
121 |
notes.push({ |
|
122 |
username: (note as any).created_by, |
|
123 |
userId: (note as any).created_by_id, |
|
124 |
avatarUrl: (note as any).avatar, |
|
125 |
items: (note as any).items, |
|
126 |
createdTime: (note as any).created, |
|
127 |
updatedTime: (note as any).updated, |
|
128 |
noteColor: (note as any).note_color, |
|
129 |
}) |
|
130 |
} |
|
131 |
|
|
132 |
return { |
|
133 |
notes, |
|
134 |
} |
|
135 |
} |
|
136 |
else{ |
|
137 |
// no notes for this item |
|
138 |
return { |
|
139 |
notes: [], |
|
140 |
} |
|
115 | 141 |
} |
116 |
} else { |
|
142 |
} |
|
143 |
else { |
|
117 | 144 |
return Promise.reject(response.data ? response.data : "Error") |
118 | 145 |
} |
119 | 146 |
} catch (err: any) { |
Také k dispozici: Unified diff
re #10454: ItemView getItemNotes