mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix nullable boolean (#8497)
* nullable boolean can now be set to null again after it weas true or false * Implementation changed to Composition API * Implementation changed to Composition API * fixed formatting issues * fixed formatting issues * fixed formatting issues * fixed formatting issues * run linters on branch * run linters on branch * run linters on branch * run linters on branch * fixed formatting issues * changes to checkbox interface reverted * changes to checkbox interface reverted * Update boolean.vue
This commit is contained in:
@@ -64,7 +64,13 @@ export class PayloadService {
|
||||
},
|
||||
async boolean({ action, value }) {
|
||||
if (action === 'read') {
|
||||
return value === true || value === 1 || value === '1';
|
||||
if (value === true || value === 1 || value === '1') {
|
||||
return true;
|
||||
} else if (value === false || value === 0 || value === '0') {
|
||||
return false;
|
||||
} else if (value === null || value === '') {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
|
||||
Reference in New Issue
Block a user