Comments (6)
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.
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.
not seeing where it would be getting an Unexpected token c
in the --data-raw
from directus.
Just to clarify, with that request you can reproduce the issue on localhost? And that is the specific request that errors out?
from directus.
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:
from directus.
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](https://private-user-images.githubusercontent.com/159483502/335002314-93949dbf-9e4d-43da-be9e-d86889f14f56.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTcyNTY3OTksIm5iZiI6MTcxNzI1NjQ5OSwicGF0aCI6Ii8xNTk0ODM1MDIvMzM1MDAyMzE0LTkzOTQ5ZGJmLTllNGQtNDNkYS1iZTllLWQ4Njg4OWYxNGY1Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYwMVQxNTQxMzlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zYWM2NDk5NWJlMjVmY2U5ZDhkMjljMjRlMWEwZDJhOWU1MGZhYmVkMjhiYWU3NGI4ZTdjNTQzZWI0NWZlNGEyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.sO7TwCBcHINMpkclePsXobt1zLCFvCjVISWtyTSKggk)
from directus.
Related Issues (20)
- Possibility to deactivate marketplace HOT 1
- "Enable Create Button" and "Enable Select Button" not shown in Many-to-One relations HOT 6
- 10.11.1 breaks our SSO HOT 8
- I cant import csv file to directus in the dashboard HOT 2
- Strange behaviour when creating a related item from the details of an existing one
- @directus/sdk registerUserVerify points to wrong endpont
- Write permissions to the directus_notifications table should be required by the app
- Provide a unique value (version identifier) when using the `Replace File` option on files/images. HOT 1
- Cockroach failing on fresh docker pull of latest Directus HOT 7
- Items not displaying in Calendar view HOT 2
- Public Permission without Id undeletable HOT 2
- Schema change based on user permissions HOT 2
- Error on instaling the extension using S3 storage HOT 7
- Document on changing system collection name in user frontend.
- Permissions Dublicate - Fix HOT 3
- ERROR: "DB_CLIENT" Environment Variable is missing HOT 3
- List in block editor generating hyperlink on the next line HOT 1
- [SDK] Custom Storage configuration sometimes causes errors
- Permission inconsitency HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from directus.