Fix: multiple list sections (#1004)
* Fix multiple list sections * singleQuotes * Update src/structures/List.js Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
parent
c55db82f73
commit
2052e0479d
1 changed files with 2 additions and 2 deletions
|
|
@ -57,7 +57,7 @@ class List {
|
||||||
*/
|
*/
|
||||||
_format(sections){
|
_format(sections){
|
||||||
if(!sections.length){throw '[LT02] List without sections';}
|
if(!sections.length){throw '[LT02] List without sections';}
|
||||||
if(sections.length > 1){throw '[LT05] Lists with more than one section are having problems';}
|
if(sections.length > 1 && sections.filter(s => typeof s.title == 'undefined').length > 1){throw '[LT05] You can\'t have more than one empty title.';}
|
||||||
return sections.map( (section) =>{
|
return sections.map( (section) =>{
|
||||||
if(!section.rows.length){throw '[LT03] Section without rows';}
|
if(!section.rows.length){throw '[LT03] Section without rows';}
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue