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

Override server methods [meteor] #413

Closed
daithi-coombes opened this issue Jun 4, 2015 · 3 comments
Closed

Override server methods [meteor] #413

daithi-coombes opened this issue Jun 4, 2015 · 3 comments

Comments

@daithi-coombes
Copy link

Hi,
@dandv

I'm using the default setup and I need to override most of the server crud methods in the rubaxa:sortable meteor package, but I can't find the information. The reason is I have one collection items, with each record containing the dropAreaId and an order field:

item: {
    _id: 'xxxxxxxxx',
    title: 'string',
    dropAreaId: integer,
    order: integer
}

When I move an item from one droppable area to another I get a duplicate key _id error from mongo, also when I start adding items to more than one droppable area then the order fields start messing up.

So this leads me to see if I can override the default add & update methods on the server side but how would I go about this?

@daithi-coombes
Copy link
Author

According to the wiki on this page: https://github.com/RubaXa/Sortable/wiki/Sortable-v1.0-%E2%80%94-New-capabilities (scroll to heading Methods for sorting acquisition and modification) - I think I should be able to overwrite the getter and setter methods, but is this not client side code? I've tried it on the server side but no joy...

//app/server/Sortable.js
'use strict'

Sortable.collections = ['items']
Sortable.create('items', {
    store: {
        get: function(sortable){
            //...
        }
    }
}

This returns:

TypeError: Object #<Object> has no method 'create'
    at app/server/Sortable.js:4:10
    at app/server/Sortable.js:12:3

@daithi-coombes
Copy link
Author

came across a quick hack to override the package: https://medium.com/@jboulhous/overriding-meteor-packages-faaaf093091

noob to meteor and node in general but maybe a feature request for hooks for CRUD actions woudl be a good direction for this issue?

@RubaXa
Copy link
Collaborator

RubaXa commented Feb 5, 2016

Dear all! Meteor is moved to the separate repository. If this issue is still actual, please create it there once again.

For your info: this project needs a maintainer.

@RubaXa RubaXa closed this as completed Feb 5, 2016
@RubaXa RubaXa unassigned dandv Dec 4, 2018
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

3 participants