Small addition to ts_api.
This commit is contained in:
parent
0d96c26174
commit
b690326cf4
@ -35,12 +35,25 @@ dispatch_request(YArg, [H|T]) ->
|
||||
end.
|
||||
|
||||
% no events, show timeline pages
|
||||
%dispatch_timeline(_YArg, Username, Timeline, []) ->
|
||||
%Req = YArg#arg.arg,
|
||||
%HTTPMethod = Req#http_request.method,
|
||||
%
|
||||
%case HTTPMethod of
|
||||
%'GET' -> list_timelines(Yarg
|
||||
dispatch_timeline(YArg, Username, Timeline, []) ->
|
||||
Req = YArg#arg.arg,
|
||||
HTTPMethod = Req#http_request.method,
|
||||
|
||||
case HTTPMethod of
|
||||
'GET' -> get_timeline(YArg, Username, Timeline);
|
||||
'PUT' -> put_timeline(YArg, Username, Timeline);
|
||||
'POST' -> post_timeline(YArg, Username, Timeline);
|
||||
'DELETE' -> delete_timeline(YArg, Username, Timeline)
|
||||
end;
|
||||
|
||||
dispatch_timeline(YArg, Username, Timeline, [H|T]) ->
|
||||
|
||||
% ============================== %
|
||||
% ======== IMPLEMENTATION ====== %
|
||||
% ============================== %
|
||||
|
||||
get_timeline(YArg, Username, TimelineId) ->
|
||||
Timeline = mnesia:dirty_read(ts_timeline, {Username, TimelineId}).
|
||||
|
||||
% ============================== %
|
||||
% ======== UTIL METHODS ======== %
|
||||
|
Loading…
x
Reference in New Issue
Block a user