Collect Film's nested data on mounted (Locations/Vehicles/People)
This commit is contained in:
@@ -9,13 +9,13 @@ export const mutations = {
|
||||
};
|
||||
|
||||
export const actions = {
|
||||
async getvehicle({ commit }, { id, callback = false }) {
|
||||
async getVehicle({ commit }, { id, callback = false }) {
|
||||
try {
|
||||
const vehicle = await this.$axios.$get(`/api/vehicles/${id}`);
|
||||
if (callback) return vehicle;
|
||||
commit("setVehicle", vehicle);
|
||||
} catch (e) {
|
||||
throw Error("API Error occurred.");
|
||||
throw Error(`API Error occurred: ${e.message}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user