This repository was archived by the owner on Aug 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
API.Routes.DatEdit
Mestre-Tramador edited this page Sep 9, 2022
·
1 revision
/dat/:id
Update a stored .dat file with a new one.
| Path | Value | Description |
|---|---|---|
| :id | number |
The numeric ID of the .dat file being read. |
| Name | Value | Description |
|---|---|---|
| Content-Type | multipart/form-data |
As a files are required, a FormData shall be sent. |
The only mandatory specification is that the first and only sent file must be a Dat file.
{
"id": 18,
"name": "18.dat",
"first_read": "2022-08-12 14:30:21",
"last_read": "2022-09-12 15:15:47",
"user": {
"id": 1,
"name": "Exper Admin"
},
"data": {
"sellers": [
{
"cpf": "736.936.580-80",
"name": "Gabriel Lasques",
"wage": 1550.0
}
],
"customers": [
{
"cnpj": "46.959.517/0001-03",
"name": "Heitor Macedo",
"branch": "Imóveis"
},
{
"cnpj": "95.230.773/0001-70",
"name": "Érica Fraga",
"branch": "Roupas"
}
],
"sales": [
{
"id": 742,
"items": [
{
"id": 65328,
"quantity": 5,
"price": 17.5
},
{
"id": 65347,
"quantity": 2,
"price": 39.99
}
],
"seller": "Gabriel Lasques"
}
]
}
}The successful result merge the basic information present no the List route,
namely the id, name, first_read, last_read, user with the one present
on the Read route in the data key.
{
"error": "File not found"
}If there is no file with the given ID, then this error is returned.
{
"error": "Invalid file"
}If the .dat file somehow is invalid or not on the pattern of the application, this error is returned.
Exper-Dat-Reader is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.
If you'd like to contribute, please read our Contribution Guidelines.