Expected behavior
When viewing list of records in a belongs to relationship, selecting a record and then delete leads to a refresh, but no delete end point is ever called.
Actual behavior
Does not call any endpoint
Failure Logs
Please include any relevant log snippets, if necessary.
Context
Please provide any relevant information about your setup.
Package Version:
Express Version:
Sequelize Version:
Database Dialect:
Database Version:
Project Name:
Hi @Liam_Cheung !
Can you fill out the context
part of your post ?
Can you share the models linked to the collections that have the belongsTo relationship ?
louis
June 16, 2020, 9:33am
3
@Liam_Cheung Looking at your screenshot it looks like a hasMany relationship.
Here Audit test
hasMany Documents
When deleting a document from an Audit test, no route/end point is ever called.
Is that right?
Hello @Liam_Cheung
I couldnāt reproduce this with a hasMany relationship. Do you have any errors in your console ?
Steve.
Nothing in the console that I can seeā¦
Note that this only happens when accessing the record through a relationship, it does work when accessing the collection directly.
Liam
vince
June 18, 2020, 8:35am
8
Hey @Liam_Cheung ,
Could you send a video reproducing this issue with your network tabs open please . You can use Loom for example.
Hi, I uploaded a quicktime to my google drive. I am hoping you can ask for permission to view and I can grant it.
https://drive.google.com/file/d/1HqySxBlRan23nJMXNFvckYfg6m_it09H/view?usp=sharing
Hi @Liam_Cheung ,
I am sorry but the video quality is so low that I cannot read the error messages.
Would you mind doing this record with something like Loom ?
Thanks!
1 Like
I just shared with you the high quality version of the file.
Hi @Liam_Cheung ,
Are your āDocumentsā linked to āAudit Testā via a smart relationship ? Iāll test in that specific case but I think this might be related to the original issue
In collection(āusersā, ā¦fields: [ā¦
{
field: ādocumentsā,
type: [āStringā],
reference: ādocument._idā,
}
], ā¦)
Great. And I guess your Documents is similar to the one from our Smart collections example ?
Iām currently giving this setup a try, just to make sure Iām able to reproduce
Actaully I see what you mean now. Both users and documents are regular mongo collections.
Hi @Liam_Cheung ,
Could you tell me how your Documents
are related to the Users
collection? Is that a subcollection (ie. documents are stored directly on users and displayed as a relationship)? Or a reference (ie. any document carry a reference to a user)?
Thanks in advance, that might be of some help to reproduce your issue.
As a reference. The document has a field user_id so the relationship lists all documents with that user id.
louis
July 10, 2020, 12:57pm
18
Hey @Liam_Cheung Iāve added a ticket on our end to tackle this issue asap. Iāll let you know once we have something on our end.
1 Like
louis
July 30, 2020, 3:53pm
19
@Liam_Cheung Weāve released a fix! We now trigger HTTP DELETE for hasMany smart relationship. Let us know if that helps!
2 Likes
Hi @louis
Thanks for this. I notice that the url comes in as:
Request URL:https://forest-map.qa.eu.mylo.ai/forest/users/5f18847ea674170007ede6ef/relationships/documents?delete=true
Request Method: DELETE
Does the parameter delete=true at the end mean anything?
Also the payload seems a little differnt than normal, when we ask to delete multiple records in a regular collection we get this payload:
Which is parsable with RecordsGetter.getIdsFromRequest
With this one will there be a parser to get the ids?
Liam