Skip to content

Commit e78d437

Browse files
committed
fix: Change fallback_code temporary fix
We actually can't send the default locale at all right now, whether on creation or update, so let's just remove it from any payloads for now.
1 parent 98795c0 commit e78d437

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

lib/entities/locale.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,8 @@ function createLocaleApi (http) {
3333
* .then(locale => console.log(locale.name))
3434
*/
3535
update: function () {
36-
// delete some properties which are returned by the server but shouldn't
37-
// be sent back.
3836
const locale = this
39-
// for the default locale, we can't send the fallback code back or we get an error
40-
if (locale.default) {
41-
delete locale.fallback_code
42-
} else {
43-
// temporary fix due to property naming weirdness
44-
locale.fallbackCode = locale.fallback_code
45-
delete locale.fallback_code
46-
}
37+
// this property shouldn't be sent back if it exists
4738
delete locale.default
4839
return createUpdateEntity({
4940
http: http,
@@ -77,6 +68,8 @@ function createLocaleApi (http) {
7768
export function wrapLocale (http, data) {
7869
const locale = mixinToPlainObject(cloneDeep(data))
7970
delete locale.internal_code
71+
// TODO this should be removed when the fallback locale issues are fixed
72+
delete locale.fallback_code
8073
enhanceWithMethods(locale, createLocaleApi(http))
8174
return freezeSys(locale)
8275
}

0 commit comments

Comments
 (0)