Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
8 13 localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-dasan committed Aug 13, 2018
1 parent 0afc13b commit 9de75d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const validExtensions = ['.png', '.jpeg', '.jpg', '.svg'];
const Config = {
serviceUrls: {
auth: `${baseUrl}/auth/v1/`,
config: `${baseUrl}/config/v1/`,
config: `http://localhost:9005/v1/`,
iotHubManager: `${baseUrl}/iothubmanager/v1/`,
telemetry: `${baseUrl}/telemetry/v1/`,
deviceSimulation: `${baseUrl}/devicesimulation/v1/`,
Expand Down
2 changes: 1 addition & 1 deletion src/services/configService.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class ConfigService {
/** Creates a new package */
static createPackage(payload) {
return HttpClient.post(`${ENDPOINT}packages`, payload)
.map(toPackageModel);
.map(toNewPackageRequestModel);
}

/** Returns all the account's packages */
Expand Down
7 changes: 4 additions & 3 deletions src/services/models/configModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ export const toPackagesModel = (response = {}) => getItems(response)

export const toPackageModel = (response = {}) => {
return camelCaseReshape(response, {
'id': 'id',
'type': 'type',
'name': 'name',
'id': 'Id',
'type': 'Type',
'name': 'Name',
'dateCreated': 'DateCreated'
});
};
8 changes: 4 additions & 4 deletions src/store/reducers/packagesReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const packageListSchema = new schema.Array(packageSchema);
// ========================= Reducers - START
const initialState = { ...errorPendingInitialState, entities: {}, items: [] };

const insertpPckageReducer = (state, { payload }) => {
const insertPackageReducer = (state, { payload }) => {
const { entities: { rules }, result } = normalize(payload, ruleListSchema);
return update(state, {
entities: { $merge: rules },
Expand Down Expand Up @@ -79,11 +79,11 @@ const updateLastTriggerReducer = (state, { payload: { id, lastTrigger } }) => up

/* Action types that cause a pending flag */
const fetchableTypes = [
epics.actionTypes.fetchRules
epics.actionTypes.fetchPackages
];

export const redux = createReducerScenario({
insertRules: { type: 'RULE_INSERT', reducer: insertRulesReducer },
insertPackages: { type: 'PACKAGE_INSERT', reducer: insertPackageReducer },
modifyRules: { type: 'RULES_MODIFY', reducer: modifyRulesReducer },
updateRules: { type: 'RULES_UPDATE', reducer: updateRulesReducer },
updateRuleCount: { type: 'RULES_COUNT_UPDATE', reducer: updateCountReducer },
Expand All @@ -96,7 +96,7 @@ export const reducer = { rules: redux.getReducer(initialState) };
// ========================= Reducers - END

// ========================= Selectors - START
export const getRulesReducer = state => state.rules;
export const getPackagesReducer = state => state.packages;
export const getEntities = state => getRulesReducer(state).entities || {};
const getItems = state => getRulesReducer(state).items || [];
export const getRulesLastUpdated = state => getRulesReducer(state).lastUpdated;
Expand Down

0 comments on commit 9de75d0

Please sign in to comment.