Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug on try delete orders #1426

Closed
natan1563 opened this issue May 25, 2023 · 2 comments
Closed

Bug on try delete orders #1426

natan1563 opened this issue May 25, 2023 · 2 comments

Comments

@natan1563
Copy link

natan1563 commented May 25, 2023

Em meu projeto, tentei realizar a exclusão de um produto com relacionamento com uma tabela de usuários, porém ao realizar a requisição, exemplo: DELETE: http://localhost:3000/orders/3 , vário produtos anteriores são excluídos do meu JSON. Segue estrutura do json:

edit in english:

In my project, I tried to delete a product related to a user table, but when making the request, for example: DELETE: http://localhost:3000/orders/3 , several previous products are excluded from my JSON. Here's the structure of the json:

{
  "orders": [
    {
      "identity": "Produto teste",
      "recipient": 4,
      "receipt_date": "21/05/2023",
      "userId": 6,
      "date_withdrawal": "",
      "apartmentId": 4,
      "id": 3
    },
    {
      "identity": "Lampada de LED RGB",
      "recipient": 4,
      "receipt_date": "23/05/2023",
      "userId": 10,
      "date_withdrawal": "23/05/2023",
      "apartmentId": 4,
      "id": 5
    },
    {
      "identity": "Monitor Ultrawide",
      "recipient": 4,
      "receipt_date": "23/05/2023",
      "userId": 19,
      "date_withdrawal": "23/05/2023",
      "apartmentId": 4,
      "id": 6
    },
    {
      "identity": "Produto 1",
      "recipient": 13,
      "receipt_date": "25/05/2023",
      "userId": "",
      "date_withdrawal": "",
      "apartmentId": 2,
      "id": 7
    },
    {
      "identity": "Produto 2",
      "recipient": 13,
      "receipt_date": "25/05/2023",
      "userId": "",
      "date_withdrawal": "",
      "apartmentId": 2,
      "id": 8
    },
    {
      "identity": "Produto 3",
      "recipient": 13,
      "receipt_date": "25/05/2023",
      "userId": "",
      "date_withdrawal": "",
      "apartmentId": 2,
      "id": 9
    }
  ],
  "apartments": [
    {
      "userId": 6,
      "cpf": "123.456.789-09",
      "code": "AB12",
      "id": 2
    },
    {
      "userId": 6,
      "cpf": "123.456.789-09",
      "code": "CT3",
      "id": 3
    },
    {
      "userId": 6,
      "cpf": "123.456.789-09",
      "code": "12AAA",
      "id": 4
    },
    {
      "userId": 9,
      "cpf": "867.430.234-56",
      "code": "15B33",
      "id": 8
    },
    {
      "userId": 10,
      "cpf": "543.705.839-12",
      "code": "777",
      "id": 9
    },
    {
      "userId": 9,
      "cpf": "867.430.234-56",
      "code": "aaaaa",
      "id": 10
    },
    {
      "userId": 6,
      "cpf": "123.456.789-09",
      "code": "24b",
      "id": 11
    },
    {
      "userId": 9,
      "cpf": "867.430.234-56",
      "code": "bbbbb",
      "id": 12
    },
    {
      "userId": 6,
      "cpf": "123.456.789-09",
      "code": "36a",
      "id": 13
    }
  ],
  "users": [
    {
      "id": 4,
      "name": "John Cena",
      "access_code": "1234",
      "cpf": "846.489.970-46",
      "user_type": "syndicate"
    },
    {
      "name": "Natã Romão",
      "cpf": "123.456.789-09",
      "user_type": "concierge",
      "access_code": "0c0b0c8077bdc0066fe710d089358b03",
      "id": 6
    },
    {
      "name": "Mario Dabarin",
      "cpf": "867.430.234-56",
      "user_type": "tenant",
      "access_code": "",
      "id": 9
    },
    {
      "name": "Jorge Nobre",
      "cpf": "543.705.839-12",
      "user_type": "syndicate",
      "access_code": "179c1ddd02dea7cafc758040bb64957b",
      "id": 10
    },
    {
      "name": "Gabriel Moreira",
      "cpf": "453.629.712-35",
      "user_type": "tenant",
      "access_code": "",
      "id": 11
    },
    {
      "name": "Matheus Moura",
      "cpf": "635.729.835-61",
      "user_type": "tenant",
      "access_code": "",
      "id": 12
    },
    {
      "name": "Fraga Fragância",
      "cpf": "555.666.777-88",
      "user_type": "syndicate",
      "access_code": "354a9758e3a90a0c0ef0d6a300480816",
      "id": 13
    }
  ]
}
@YoussefErradi
Copy link

did you find the solution ?

@soham0005
Copy link

Could you please elaborate more so that the actual error can be solved and if not assigned to anyone please assign it to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants