Giter Club home page Giter Club logo

Comments (6)

hanneskuettner avatar hanneskuettner commented on June 25, 2024

Heya, I'm unable to reproduce this with the steps you have described.

Can you share the exact request (without exposing your URL of course) that is being made to the backend? You will see it in the Network tab of your browser developer tools. This might help track down the issue.

from directus.

michael-narrowstack avatar michael-narrowstack commented on June 25, 2024

hey @hanneskuettner thanks for the quick reply.

Heres my request when copying it as a curl command:


curl 'http://localhost:8055/items/pages/1072ac85-2f77-4746-b9e7-9dcabd0dc4f5' \
  -X 'PATCH' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en-US,en' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Cookie: user_timezone=America%2FChicago; next-auth.csrf-token=8fdb85d4b65255855da667af71812cf46911b55eb413d4c337be5fc653fa9459%7Ccc446bb931fd8e391989a0953078020fce750e6cda54695c2848c1088fe5dc62; user_market=global; next-auth.callback-url=http%3A%2F%2Flocalhost%3A3000; next-auth.session-token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..Cp39alNyM8HW0tFl.jBRresjYJ7Du-BNePgIoDavfBqpaEQBxcU7zcytDsYFhfRdb1SoNu7RuMwq7Y4UkAzP4-WKIOTh8MN9w4AHeuzDpD9hH4mOLyiD_yS1Thq9N1sz-msB_54WF4WvIlcqAybc8co95R2l7EFL7UAXQr3eNixco8rMNHW_ycufRSUf2SPtzsS1ZGF9wJyT6q21_TR9U5FK2hLBWi0wzEMTBWOLABKq5z0qKF8nDeFr8g140nP3fR32f6sf8rBnudqQ6AlLnr6DrNSWiGiD2gLQv5QXgH-Uedbm0uT7gD9yj74iTosW_1JGzXJkHkBDmGP8_aYdM3mGD8W38sON00UMc_I1CQete15MiX4SB2o6ekkYdEB1FWFCZN1Ge4rfiDTAx6cXcdGAyho_dm8ZhML0S8HDP_BNxI_J-Whl9UoBy7SH5N-Ehz-9I819J5kd4VHUIonwNbx0Z4qHCAKrCoh33joLxzoQ45c_cHCyY6c65ljZ2QIA0Ufl9EhHpMWw5lHpXP6Dy-hhRiS5YZZ3agCfWvbca-bCnMXomw01wakZO4_2EqFD56tyzukMAYCpT8PixbXaLBlZO_c9t1rNNYluNqCbEuP6XfLjmn85bKs5krWWhGRj31iKQXKfXoWqS4hiV4c_MztxXPueL-aMHUBOu5G9nqcY20rhk7l61ZKgFU06qcAUHM_GMy4-INzZvqg-Z7d1t9BxITXxP5mXVXgdPJl_VmTxKHsUNO8hib9LuyKd_iTezyINrdLbZe_QdVtNAbcNbL2hAwt-SSiCBwGIOLXJyVaHULCmjK1PC52IcgsoeoCcCj8tzrnil5SKOShd7WrLzE7NrIPj2Tuet3ROIzAMZE4OFD0SeLawYWjAu-2Z3euYuO-aQdUmX7D320nB9IdHwYTMO4I8Z8WBbRZ6GOfHi_K4.tilc6EZxkuz5Ne13cdyivA; directus_session_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijg1YWM5MjZlLWFhOWUtNDNjYS05M2RlLWY3YmIzODlmYjE4OSIsInJvbGUiOiI3N2JiOGVhMi1iMGY2LTQyMWItYmYzYi1jYTlhZTY1NWUxOWIiLCJhcHBfYWNjZXNzIjp0cnVlLCJhZG1pbl9hY2Nlc3MiOnRydWUsInNlc3Npb24iOiJjMXU4ZnZXeDhVUVJ4Vk1US1dCQmlVWDBoVG1Nb3V1V2ZELUpEZjBfeVhsTWVaOWkxWnNzdGhYQUVrbVAtYzZnIiwiaWF0IjoxNzE3MDA1ODY2LCJleHAiOjE3MTcwOTIyNjYsImlzcyI6ImRpcmVjdHVzIn0.XKx7VkT-wfQTAooAz02-jsWd-KT0-AF5g-4Xej1olSw' \
  -H 'Origin: http://localhost:8055' \
  -H 'Referer: http://localhost:8055/admin/content/pages/1072ac85-2f77-4746-b9e7-9dcabd0dc4f5' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'Sec-GPC: 1' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua: "Brave";v="123", "Not:A-Brand";v="8", "Chromium";v="123"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  --data-raw '{"blocks":{"create":[],"update":[],"delete":[2]}}'
  

from directus.

michael-narrowstack avatar michael-narrowstack commented on June 25, 2024

not seeing where it would be getting an Unexpected token c in the --data-raw

from directus.

hanneskuettner avatar hanneskuettner commented on June 25, 2024

Just to clarify, with that request you can reproduce the issue on localhost? And that is the specific request that errors out?

from directus.

michael-narrowstack avatar michael-narrowstack commented on June 25, 2024

Yes.

If I use --data-raw '{"blocks":{"create":[],"update":[],"delete":[1]}}'
or --data-raw '{"blocks":{"create":[],"update":[],"delete":[2]}}'
or --data-raw '{"blocks":{"create":[],"update":[],"delete":[1, 2]}}'

I get the error

If I don't do a delete, using: --data-raw '{"blocks":{"create":[],"update":[],"delete":[]}}'
then this is the object I get returned:

{"data":{"block_background":true,"date_created":"2024-05-14T20:51:12","date_updated":"2024-05-29T19:17:58","id":"1072ac85-2f77-4746-b9e7-9dcabd0dc4f5","no_header":false,"seo":null,"slug":"/","sort":null,"status":"published","title":"home","user_created":"85ac926e-aa9e-43ca-93de-f7bb389fb189","user_updated":"85ac926e-aa9e-43ca-93de-f7bb389fb189","blocks":[1,2]}}

Notice there are blocks 1 and 2

Here is what my item looks like in the UI:
image

from directus.

michael-narrowstack avatar michael-narrowstack commented on June 25, 2024

It ended up being this setting. Still not sure why I am getting the error when set to Delete the page_blocks item, but setting to Nullify the item field fixed it.

Screenshot 2024-05-29 at 8 40 05 PM

from directus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.