summaryrefslogtreecommitdiff
path: root/src/actions.js
blob: c1e8d236578ae3755d8c4a84ea73d1aa3a39dfdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import * as aggietime from "./aggietime.js";

const ACTIONS = {
  "clock-in": aggietime.clock_in,
  "clock-out": aggietime.clock_out,
  "current-shift": aggietime.current_shift,
  "current-user": aggietime.get_user_info,
  "status-line": aggietime.get_status_line,
  "past-week": aggietime.last_week,
};

export const do_action = async (body) => {
  const { action, rest } = body;

  return await ACTIONS[action](rest);
};