Skip to content

Commit

Permalink
Improve select type init for form
Browse files Browse the repository at this point in the history
  • Loading branch information
kekefreedog committed Dec 13, 2024
1 parent e8011d5 commit a6b4f9b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Front/Library/Utility/Form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import Page from '../Loader/Page';
import { MaskInput } from "maska"
import Root from '../Dom/Root';
import Arrays from './Arrays';
import Objects from './Objects';

/**
* Form
Expand Down Expand Up @@ -2196,6 +2197,19 @@ export default class Form {

).then(
value => {

// Check value results
if(
"results" in value &&
Array.isArray(value.results) &&
value.results.length
)

// Iteration value
for(let key in value.results)

// Set key
value.results[key] = Objects.flatten(value.results[key], "", ".");

// Callback with value retrieve
callback(value.results);
Expand Down Expand Up @@ -2228,6 +2242,19 @@ export default class Form {
).then(
value => {

// Check value results
if(
"results" in value &&
Array.isArray(value.results) &&
value.results.length
)

// Iteration value
for(let key in value.results)

// Set key
value.results[key] = Objects.flatten(value.results[key], "", ".");

// Add options to tom
selectInstance.addOptions(value.results);

Expand Down

0 comments on commit a6b4f9b

Please sign in to comment.