Skip to content

Commit

Permalink
feat: add getMarkRules
Browse files Browse the repository at this point in the history
  • Loading branch information
brage-andreas committed Sep 13, 2024
1 parent 65ef7f2 commit ac7f890
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/profile/api/penalties.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { get, IAPIData } from 'common/utils/api';

import { IMark, ISuspension } from '../models/Penalty';
import { IMark, IMarkRule, ISuspension } from '../models/Penalty';
import { getUser } from 'authentication/api';

const API_URL = '/api/v1/profile';
const BASE_API_URL = '/api/v1';
const API_URL = BASE_API_URL + '/profile';
const MARKS_URL = API_URL + '/marks/';
const MARK_RULES_URL = BASE_API_URL + '/marks/rule-sets/';
const SUSPENSIONS_URL = API_URL + '/suspensions/';

/**
Expand All @@ -16,6 +18,14 @@ export const getMarks = async (): Promise<IMark[]> => {
return results;
};

/**
* @summary Fetch Mark Rules from API.
*/
export const getMarkRules = async (): Promise<IMarkRule[]> => {
const { results } = await get<IAPIData<IMarkRule>>(MARK_RULES_URL, { format: 'json' });
return results;
};

/**
* @summary Fetch Suspensions from API.
*/
Expand Down

0 comments on commit ac7f890

Please sign in to comment.