predbdotovh / pre-api

https://predbdotovh.github.io/pre-api/
MIT License
42 stars 7 forks source link

json: cannot unmarshal string into Go struct field preRow.size of type float64 #27

Open ERR1R opened 2 years ago

ERR1R commented 2 years ago

Hi, seems i have it working with rabbitmq to insert realtime.. but when i update the size i get this message on the api.

2022/07/27 14:24:52 pre.update

2022/07/27 14:24:52 json: cannot unmarshal string into Go struct field preRow.size of type float64

Im sending with php. I thought maybe i should do something like this:


$size = number_format($size, 2);

            $data = array(
                "id"=> $id,
                "name"=> $release,
                "team"=> $team,
                "cat"=> $cat,
                "genre"=>  $genre,
                "url"=>  $url,
                "size"=> $size,
                "files"=> $files,
                "preAt"=> $timestamp,
            );

but same error.

can you help me to fix this?

ghost commented 1 year ago

You can try strval($size)