Skip to content

Commit 57c71cd

Browse files
committed
fix: also delete fallback on update
1 parent e374294 commit 57c71cd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/entities/locale.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ function createLocaleApi (http) {
3636
const locale = this
3737
// this property shouldn't be sent back if it exists
3838
delete locale.default
39+
delete locale.fallback_code
40+
delete locale.fallbackCode
3941
return createUpdateEntity({
4042
http: http,
4143
entityPath: 'locales',
@@ -66,11 +68,12 @@ function createLocaleApi (http) {
6668
* @return {Locale} Wrapped locale data
6769
*/
6870
export function wrapLocale (http, data) {
69-
const locale = mixinToPlainObject(cloneDeep(data))
70-
delete locale.internal_code
71+
delete data.internal_code
7172
// TODO this should be removed when the fallback locale issues are fixed
7273
// also remove deletion on createLocale in create-space-api
73-
delete locale.fallback_code
74+
delete data.fallback_code
75+
delete data.fallbackCode
76+
const locale = mixinToPlainObject(cloneDeep(data))
7477
enhanceWithMethods(locale, createLocaleApi(http))
7578
return freezeSys(locale)
7679
}

0 commit comments

Comments
 (0)