Skip to content

Commit 5654dbd

Browse files
refactor: rename services to apiClients when needed
1 parent e03d878 commit 5654dbd

File tree

22 files changed

+62
-61
lines changed

22 files changed

+62
-61
lines changed

components/alert/AlertAddAnalysis.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const addFile = (event: Event) => {
8585
const uploadFile = async () => {
8686
if (!file.value) return;
8787
loading.value = true;
88-
await $api.curService.uploadFile(file.value);
88+
await $api.curApiClient.uploadFile(file.value);
8989
loading.value = false;
9090
emit("update:analyses");
9191
closeModal();

components/comparative/ComparativeByRegion.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ interface Props {
6363
const props = defineProps<Props>();
6464
6565
const resultsByRegion: Ref<RegionCarbonFootprint[]> = ref(
66-
await $api.carbon.compareCarbonFootPrintbByRegion(
66+
await $api.carbonService.compareCarbonFootPrintbByRegion(
6767
props.infrastructureId,
6868
props.totalCO2Gr,
6969
),

components/configurationSettings/ConfigurationSettingsInstanceType.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const { $api } = useNuxtApp();
2626
const instanceTypes: Ref<string[]> = ref([]);
2727
const isInstanceEmpty = ref(false);
2828
29-
$api.instanceType.getAllInstanceByType("EC2").then((responses) => {
29+
$api.awsInstanceApiClient.getAllInstanceByType("EC2").then((responses) => {
3030
instanceTypes.value = responses.map((response) => response.name);
3131
});
3232

components/infrastructure/InfrastructureCreate.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const handleSubmit = form.handleSubmit(async (values) => {
120120
defaultRegion: values.region.id,
121121
name: values.infraName,
122122
};
123-
await $api.infrastructureService.createNewInfra(infra);
123+
await $api.infrastructureApiClient.createNewInfra(infra);
124124
await infrastructuresStore.fetchInfrastructures();
125125
isDialogOpen.value = false;
126126
emit("infraCreated");

components/infrastructure/InfrastructureDataTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function deleteInfrastructure(infrastructure: Infrastructure) {
9797
}
9898
9999
async function confirmInfrastructureDeletion(infrastructure: Infrastructure) {
100-
await $api.infrastructureService.deleteInfra(infrastructure.id!);
100+
await $api.infrastructureApiClient.deleteInfra(infrastructure.id!);
101101
await infrastructuresStore.fetchInfrastructures();
102102
}
103103

pages/admin/dashboard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const notificationHandler = useToast();
2828
const { $api } = useNuxtApp();
2929
3030
const clearCache = async () => {
31-
await $api.adminService.evictRegionCache().then(() =>
31+
await $api.adminApiClient.evictRegionCache().then(() =>
3232
notificationHandler.add({
3333
title: $t("admin.regionCache.notifyCleared"),
3434
color: NuxtColors.success,

pages/calculatrice/estimation/[infrastructureID]/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ const infrastructureId: string = Array.isArray(route.params.infrastructureID)
5252
: route.params.infrastructureID;
5353
5454
const results = ref(
55-
await $api.carbon.estimateCarbonFootPrint(infrastructureId),
55+
await $api.carbonService.estimateCarbonFootPrint(infrastructureId),
5656
);
5757
5858
infrastructure.value =
59-
await $api.infrastructureService.getInfrastructure(infrastructureId);
59+
await $api.infrastructureApiClient.getInfrastructure(infrastructureId);
6060
</script>

pages/calculatrice/infrastructure/[infrastructureID]/available-services.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const route = useRoute();
6464
6565
const services = ref<CloudServiceProviderService[]>([]);
6666
services.value =
67-
await $api.cloudServiceProviderService.getCloudServiceProviderServices();
67+
await $api.cloudServiceProviderApiClient.getCloudServiceProviderServices();
6868
6969
const goToComponentConfiguration = (
7070
cloudServiceProviderService: CloudServiceProviderService,

pages/calculatrice/infrastructure/[infrastructureID]/create-component.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ const { cloudServiceProviderServiceID, componentId, serviceName } =
113113
route.query as QueryParams;
114114
115115
const components = ref(
116-
await $api.componentService.getComponentsByInfrastructureId(infrastructureId),
116+
await $api.componentApiClient.getComponentsByInfrastructureId(
117+
infrastructureId,
118+
),
117119
);
118120
119121
const originalComponent = components.value.find(
@@ -133,7 +135,7 @@ const isOtherRegion = ref(
133135
);
134136
135137
const serviceConfigurationSettings = ref<ServiceConfigurationSetting[]>(
136-
await $api.serviceConfigurationSettingSvc.findAllConfigurationSettingsByServiceId(
138+
await $api.serviceConfigurationSettingApiClient.findAllConfigurationSettingsByServiceId(
137139
originalComponent
138140
? originalComponent.serviceID
139141
: cloudServiceProviderServiceID,
@@ -171,12 +173,12 @@ const handleSubmit = async () => {
171173
serviceID: cloudServiceProviderServiceID,
172174
};
173175
if (originalComponent) {
174-
await $api.componentService.updateComponent({
176+
await $api.componentApiClient.updateComponent({
175177
...component,
176178
id: originalComponent.id,
177179
});
178180
} else {
179-
await $api.componentService.saveComponent(component);
181+
await $api.componentApiClient.saveComponent(component);
180182
}
181183
await navigateTo(`/calculatrice/infrastructure/${infrastructureId}`);
182184
};

pages/calculatrice/infrastructure/[infrastructureID]/index.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ const infrastructureId: string = Array.isArray(route.params.infrastructureID)
116116
117117
const { $api } = useNuxtApp();
118118
const components = ref(
119-
await $api.componentService.getComponentsByInfrastructureId(infrastructureId),
119+
await $api.componentApiClient.getComponentsByInfrastructureId(
120+
infrastructureId,
121+
),
120122
);
121123
122124
const componentToDelete = ref<string>("");
@@ -134,18 +136,18 @@ const addComponent = () => {
134136
};
135137
136138
async function deleteComponent() {
137-
await useNuxtApp().$api.componentService.deleteComponent(
139+
await useNuxtApp().$api.componentApiClient.deleteComponent(
138140
componentToDelete.value,
139141
);
140142
components.value =
141-
await $api.componentService.getComponentsByInfrastructureId(
143+
await $api.componentApiClient.getComponentsByInfrastructureId(
142144
infrastructureId,
143145
);
144146
}
145147
const navigateToEdit = async (component: Component) => {
146148
const { id: componentId, serviceID } = component;
147149
const serviceName =
148-
(await $api.catalogService.getById(serviceID)).shortname ?? "";
150+
(await $api.catalogApiClient.getById(serviceID)).shortname ?? "";
149151
navigateTo({
150152
path: `/calculatrice/infrastructure/${infrastructureId}/create-component`,
151153
query: {

0 commit comments

Comments
 (0)