Skip to content

Commit

Permalink
Resolved FIXME to fetch model from model configuration id (#4265)
Browse files Browse the repository at this point in the history
  • Loading branch information
jryu01 authored Jul 25, 2024
1 parent 69f2a8f commit 8d5d282
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,8 @@ import TeraDrilldownPreview from '@/components/drilldown/tera-drilldown-preview.
import TeraSaveDatasetFromSimulation from '@/components/dataset/tera-save-dataset-from-simulation.vue';
import TeraPyciemssCancelButton from '@/components/pyciemss/tera-pyciemss-cancel-button.vue';
import TeraOperatorOutputSummary from '@/components/operator/tera-operator-output-summary.vue';
import { getUnitsFromModelParts } from '@/services/model';
import {
createModelConfiguration,
getAsConfiguredModel,
getModelConfigurationById
} from '@/services/model-configurations';
import { getUnitsFromModelParts, getModelByModelConfigurationId } from '@/services/model';
import { createModelConfiguration, getModelConfigurationById } from '@/services/model-configurations';
import {
convertToCsvAsset,
getRunResult,
Expand Down Expand Up @@ -572,9 +568,12 @@ const formatJsonValue = (value) => {
const initialize = async () => {
const modelConfigurationId = props.node.inputs[0].value?.[0];
if (!modelConfigurationId) return;
modelConfiguration.value = await getModelConfigurationById(modelConfigurationId);
// FIXME: #getAsConfiguredModel or GET /model-configurations/as-configured-model/{id} isn't intended to be used here, switch to use the api endpoint to fetch the model metadata by model config id.
model.value = await getAsConfiguredModel(modelConfiguration.value);
const results = await Promise.all([
getModelConfigurationById(modelConfigurationId),
getModelByModelConfigurationId(modelConfigurationId)
]);
modelConfiguration.value = results[0];
model.value = results[1];
const policyId = props.node.inputs[2]?.value?.[0];
if (policyId) {
Expand Down

0 comments on commit 8d5d282

Please sign in to comment.