Skip to content

Commit 84388d2

Browse files
committed
fix the case when trait is existent but categoryName is null
1 parent 5dc286c commit 84388d2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/routes/settings/actions/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,12 @@ export const saveProfileSettings = (settings) => (dispatch, getState) => {
201201
const state = getState()
202202
const handle = _.get(state, 'loadUser.user.handle')
203203
const traits = _.get(state, 'settings.profile.traits')
204-
const existentTraitIds = _.map(traits, 'traitId')
204+
const existentTraitIds = _.map(
205+
// some traits could have categoryName as null
206+
// for such traits we have to use POST method instead of PUT or we will get
207+
// error 404 for such traits
208+
traits.filter((trait) => trait.categoryName),
209+
'traitId')
205210
const updatedTraits = applyProfileSettingsToTraits(traits, settings)
206211

207212
// we will only update on server traits which can be updated on the settings page

0 commit comments

Comments
 (0)