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

Inconsistency between Wagon and Engine (content_type_slug_singular vs content_type_slug_singluar_id) #406

Open
greyskin opened this issue Sep 23, 2021 · 0 comments

Comments

@greyskin
Copy link

greyskin commented Sep 23, 2021

When creating a JS object (to use in a Liquid Actions API createEntry), the following doesn't work in wagon:

var order = {
    name: foo,
    user: bar.id // where the "user" field refers to "users" content_type; "orders" belongs_to "users"; "users" has_many "orders"
}

order = createEntry( 'orders', order );

Note: user: bar.id

The above will create an order with nil user:

{"name"=>"foo", "user_id"=>nil}

However, if I upload this to engine, the above will create an order with a user.

{"name"=>"foo", "user_id"=>"bar"}

To get it working in wagon, I have to re-write my JS object as follows:

var order = {
    name: foo,
    user_id: bar.id
}

Note: user_id: bar.id

However, conversely to the first code sample, if I upload the above to engine, it doesn't work.

Am I doing something wrong?

@greyskin greyskin changed the title Inconsistency between Wagon and Engine Inconsistency between Wagon and Engine (content_type_slug_singular vs content_type_slug_singluar_id) Sep 23, 2022
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

1 participant