This will add a new fetch class at koha-tmpl/intranet-tmpl/prog/js/vue/fetch/item-api-client.js to easily list the items from Vue components.
Created attachment 152468 [details] [review] Bug 34055: Add API client class to get items This patch add a new item-api-client.js API client to fetch items using our /items REST API endpoint. Test plan: Add the following two lines to one of the existing Vue component (in data() for instance) and hit the view that is using it. let client = APIClient.item client.items.getAll().then((items) => console.log(items)) Notice that you see all the items in the console. Sponsored-by: BULAC - http://www.bulac.fr/
Created attachment 152470 [details] [review] Bug 34055: Add API client class to get items This patch add a new item-api-client.js API client to fetch items using our /items REST API endpoint. Test plan: Add the following two lines to one of the existing Vue component (in data() for instance) and hit the view that is using it. let client = APIClient.item client.items.getAll().then((items) => console.log(items)) Notice that you see all the items in the console. Sponsored-by: BULAC - http://www.bulac.fr/
Created attachment 153098 [details] [review] Bug 34055: Rebased on top of 34219
Created attachment 153529 [details] [review] Bug 34055: Add API client class to get items This patch add a new item-api-client.js API client to fetch items using our /items REST API endpoint. Test plan: Add the following two lines to one of the existing Vue component (in data() for instance) and hit the view that is using it. let client = APIClient.item client.items.getAll().then((items) => console.log(items)) Notice that you see all the items in the console. Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Created attachment 153530 [details] [review] Bug 34055: Rebased on top of 34219 Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Created attachment 156019 [details] [review] Bug 34055: Add API client class to get items This patch add a new item-api-client.js API client to fetch items using our /items REST API endpoint. Test plan: Add the following two lines to one of the existing Vue component (in data() for instance) and hit the view that is using it. let client = APIClient.item client.items.getAll().then((items) => console.log(items)) Notice that you see all the items in the console. Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Was failing the pretty test, fixed with yarn pretty Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 156020 [details] [review] Bug 34055: Rebased on top of 34219 Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.04