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

No Push/Pull option when there are no stores. #22

Open
KevinJump opened this issue Mar 21, 2023 · 1 comment
Open

No Push/Pull option when there are no stores. #22

KevinJump opened this issue Mar 21, 2023 · 1 comment
Assignees

Comments

@KevinJump
Copy link
Collaborator

KevinJump commented Mar 21, 2023

When a vendr installation has no Stores, there is no push/pull option on the root 'Stores' node - so you can't pull the stores from another existing site.

there should be a 'push/pull' at the root 'Stores' node just like there is for Content and Media when using uSync.Complete

@KevinJump KevinJump self-assigned this Mar 21, 2023
@KevinJump
Copy link
Collaborator Author

I think it's probably here

https://github.com/vendrhub/vendr-usync/blob/v2/dev/src/Vendr.uSync/SyncManagers/OrderSyncManager.cs#L70-L88

        private SyncLocalItem GetStoreItem(string id)
        {
            // only showing the menu for the store 
            var storeGuid = GetStoreGuid(id);
            if (storeGuid == null) return null;


            // the isVendrStore proved this was a guid.


            var store = _vendrApi.GetStore(storeGuid.Value);
            if (store == null) return null;


            return new SyncLocalItem
            {
                EntityType = VendrConstants.UdiEntityType.Store,
                Id = store.Id.ToString(),
                Name = store. Name,
                Udi = Udi.Create(VendrConstants.UdiEntityType.Store, store.Id)
            };
        }

where we return nothing if we can't find the store. guessing we actually do get triggered when the top 'Stores' node is picked, but passed a root value (like -1).

in this case if we return a SyncLocalItem with a root UDI for the stores in it might 'just work'

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