|
Lines 205-233
const insertSampleHold = async ({
Link Here
|
| 205 |
return { hold, patron }; |
205 |
return { hold, patron }; |
| 206 |
}; |
206 |
}; |
| 207 |
|
207 |
|
| 208 |
const insertSampleCheckout = async ({ baseUrl, authHeader }) => { |
208 |
const insertSampleCheckout = async ({ patron, baseUrl, authHeader }) => { |
| 209 |
const { biblio, items, libraries, item_type } = await insertSampleBiblio({ |
209 |
const { biblio, items, libraries, item_type } = await insertSampleBiblio({ |
| 210 |
item_count: 1, |
210 |
item_count: 1, |
| 211 |
baseUrl, |
211 |
baseUrl, |
| 212 |
authHeader, |
212 |
authHeader, |
| 213 |
}); |
213 |
}); |
| 214 |
const generatedPatron = await buildSampleObject({ |
|
|
| 215 |
object: "patron", |
| 216 |
values: { |
| 217 |
library_id: libraries[0].library_id, |
| 218 |
incorrect_address: null, |
| 219 |
patron_card_lost: null, |
| 220 |
}, |
| 221 |
baseUrl, |
| 222 |
authHeader, |
| 223 |
}); |
| 224 |
|
214 |
|
| 225 |
const patron = await insertObject({ |
215 |
let generatedPatron; |
| 226 |
type: "patron", |
216 |
if (!patron) { |
| 227 |
object: generatedPatron, |
217 |
generatedPatron = await buildSampleObject({ |
| 228 |
baseUrl, |
218 |
object: "patron", |
| 229 |
authHeader, |
219 |
values: { |
| 230 |
}); |
220 |
library_id: libraries[0].library_id, |
|
|
221 |
incorrect_address: null, |
| 222 |
patron_card_lost: null, |
| 223 |
}, |
| 224 |
}); |
| 225 |
|
| 226 |
patron = await insertObject({ |
| 227 |
type: "patron", |
| 228 |
object: generatedPatron, |
| 229 |
baseUrl, |
| 230 |
authHeader, |
| 231 |
}); |
| 232 |
} |
| 231 |
|
233 |
|
| 232 |
const generatedCheckout = buildSampleObject({ |
234 |
const generatedCheckout = buildSampleObject({ |
| 233 |
object: "checkout", |
235 |
object: "checkout", |
|
Lines 243-249
const insertSampleCheckout = async ({ baseUrl, authHeader }) => {
Link Here
|
| 243 |
baseUrl, |
245 |
baseUrl, |
| 244 |
authHeader, |
246 |
authHeader, |
| 245 |
}); |
247 |
}); |
| 246 |
return { biblio, items, libraries, item_type, patron, checkout }; |
248 |
return { |
|
|
249 |
biblio, |
| 250 |
items, |
| 251 |
libraries, |
| 252 |
item_type, |
| 253 |
patron, |
| 254 |
checkout, |
| 255 |
...(generatedPatron ? { patron: generatedPatron } : {}), |
| 256 |
}; |
| 247 |
}; |
257 |
}; |
| 248 |
|
258 |
|
| 249 |
const deleteSampleObjects = async allObjects => { |
259 |
const deleteSampleObjects = async allObjects => { |
| 250 |
- |
|
|