Kazoo 2561

i followed the path taken with users, but i will correct it.

On Thu, Dec 11, 2014 at 12:00 AM, James Aimonetti <notifications@github.com>
wrote:

> In applications/crossbar/src/modules_v2/cb_devices_v2.erl
> <https://github.com/2600hz/kazoo/pull/667#discussion-diff-21649102>:
>
> > @@ -141,6 +143,28 @@ authorize(_Verb, _Nouns) ->
> >  %%--------------------------------------------------------------------
> >  %% @public
> >  %% @doc
> > +%% This function determines if the provided list of Nouns and Resource Ids are valid.
> > +%% If valid, updates Context with deviceId
> > +%%
> > +%% Failure here returns 404
> > +%% @end
> > +%%--------------------------------------------------------------------
> > +-spec validate_resource(cb_context:context()) -> cb_context:context().
> > +-spec validate_resource(cb_context:context(), path_token()) -> cb_context:context().
> > +validate_resource(Context) -> Context.
> > +validate_resource(Context, DeviceId) -> validate_device_id(DeviceId, Context).
> > +
> > +-spec validate_device_id(api_binary(), cb_context:context()) -> cb_context:context().
> > +validate_device_id(DeviceId, Context) ->
>
> Why swap the order of the args? Just leave them (Context, DeviceId) since
> that's what validate_resource/2 is doing.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/2600hz/kazoo/pull/667/files#r21649102>.
>