Replace fixed paths with response from API
Currently, the Redfish request used fixed URIs, modify the code to use
the BMC and System paths got from response of API calls.
For CertificateStore, since it was using the URL for constant variable
assignment, changed the constant CERTIFICATE_TYPES to method call.
Change-Id: I330b7272083e3e6993aae5705aae170b8e9a4659
Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
diff --git a/src/store/modules/HardwareStatus/ServerLedStore.js b/src/store/modules/HardwareStatus/ServerLedStore.js
index af22802..d4af064 100644
--- a/src/store/modules/HardwareStatus/ServerLedStore.js
+++ b/src/store/modules/HardwareStatus/ServerLedStore.js
@@ -17,7 +17,7 @@
actions: {
async getIndicatorLedActiveState({ commit }) {
return await api
- .get('/redfish/v1/Systems/system')
+ .get(`${await this.dispatch('global/getSystemPath')}`)
.then((response) => {
commit(
'setIndicatorLedActiveState',
@@ -29,7 +29,7 @@
async saveIndicatorLedActiveState({ commit }, payload) {
commit('setIndicatorLedActiveState', payload);
return await api
- .patch('/redfish/v1/Systems/system', {
+ .patch(`${await this.dispatch('global/getSystemPath')}`, {
LocationIndicatorActive: payload,
})
.catch((error) => {