Skip to content

Commit

Permalink
Rename pvType and pvID properties to type and id
Browse files Browse the repository at this point in the history
  • Loading branch information
mitjak committed Dec 7, 2023
1 parent c55913e commit cbd8d34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/dataimport/PlanetaryVariablesDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ export class PlanetaryVariablesDataProvider extends AbstractTPDProvider {
protected getAdditionalSearchParams(params: TPDISearchParams): any {
const data: any = {};

if (!params.pvType) {
throw new Error('Parameter pvType must be specified');
if (!params.type) {
throw new Error('Parameter type must be specified');
}

if (!params.pvId) {
throw new Error('Parameter pvId must be specified');
if (!params.id) {
throw new Error('Parameter id must be specified');
}

data.pvType = params.pvType;
data.pvId = params.pvId;
data.type = params.type;
data.id = params.id;

//check if pvId is supported for selected pvType
if (PlanetSupportedPVIds[params.pvType] && !PlanetSupportedPVIds[params.pvType].includes(params.pvId)) {
//check if id is supported for selected type
if (PlanetSupportedPVIds[params.type] && !PlanetSupportedPVIds[params.type].includes(params.id)) {
throw new Error(`Source ID is not supported for selected Source Type`);
}

Expand Down
4 changes: 2 additions & 2 deletions src/dataimport/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ export type TPDISearchParams = {
sensor?: MaxarSensor;
itemType?: PlanetItemType;
productBundle?: PlanetProductBundle;
pvType?: PlanetPVType;
pvId?: PlanetPVId;
type?: PlanetPVType;
id?: PlanetPVId;
};

export type TPDITransactionParams = {
Expand Down

0 comments on commit cbd8d34

Please sign in to comment.