Dato.config.js help

trying to setup redirects on netlify and need this TOML file outputted from netlify

[[redirects]]
  from = "/*"
  to = "/dashboard"
  status = 200
  force = false
  query = {path = ":path"} # apply this rule for /?path=example
  conditions = {Role = ["admin"]}
      
[[redirects]]
  from = "/*"
  to = "/login"
  status = 302

I wrote this


    root.createDataFile('netlify.toml', 'toml',
        dato.redirects.map(redirect => {
            return {
                redirects: {
                    to: redirect.to,
                    from: redirect.from,
                    status: redirect.stat
                }
            };
        })
    );

whichs i giving me this

[[redirects]
to = "/Blog/best-way-build-image"
from = "/Blog/want-more-repeat-business-then-dont-make-this-mistake/"
status = "301"

, [redirects]
to = "/Blog/best-way-build-image"
from = "/Blog/using-video-improve-companys-message/"
status = "301"

]

what am i doing wrong??

@derrick did you solve your issue? Looks like the toml formatter has a problem?

I’m asking this as I saw you tried also over Slack and I’m not sure if your situation evolved

Sorry for the delay here @derrick but I’ve finally found the issue.

It’s with our TOML library not having implemented array of tables: https://github.com/alexbeletsky/toml-js/issues/4

I’m going to give this one a shot: https://github.com/iarna/iarna-toml that looks more complete. I’ll be in touch very soon!

hey @derrick we have released a new version of the JS client, the 3.0.11 that fixes your issue!

We have replaced the toml library, the one we were using didn’t support array of tables :frowning: