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

Extra Methods return indexed data array with missing model context #24

Open
adm-bome opened this issue Feb 1, 2021 · 0 comments
Open

Comments

@adm-bome
Copy link

adm-bome commented Feb 1, 2021

Hi,

The extra methods: prefixed with a $ sign, do work.
There is only one issue that bothers me.

When the extra methods resolve, and everything is as it should supposed to be, the result is a array of records without context.

The way vuex-orm returns the result is in an multidimentional assoc array with the key being the models entity name.
Vuex-orm method like: update returns multiple records, but grouped by there model entity name.

The methods (in this lib) like: $update return an flattend indexed array with records. There is no way to know what typeof record it is when looping though them.

For example: when you want to store a Contact with a or multiple relation(s) to a Address model.

Is there some special reason the outputs are different? Did nobody noticed this type of behavior?

In my humble opinion the outputs/resolved returns should be inline with each other. Mainly because this is only a plugin that adds an extra abbility and should not define or alter outputs.

@adm-bome adm-bome changed the title Extra Methods return indexed data array with no model context Extra Methods return indexed data array with missing model context Feb 1, 2021
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