Frontend: Code cleanup (#8583)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect } from "react";
|
||||
import React from "react";
|
||||
|
||||
import { ITeam } from "interfaces/team";
|
||||
import { IEnrollSecret } from "interfaces/enroll_secret";
|
||||
|
||||
@@ -23,7 +23,13 @@ const Chevron = ({
|
||||
direction = "down",
|
||||
}: IChevronProps) => {
|
||||
return (
|
||||
<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useContext, useEffect } from "react";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { IAceEditor } from "react-ace/lib/types";
|
||||
import { noop, size } from "lodash";
|
||||
import { useDebouncedCallback } from "use-debounce";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import endpoints from "utilities/endpoints";
|
||||
import { IActivity } from "interfaces/activity";
|
||||
import sendRequest from "services";
|
||||
import { buildQueryStringFromParams } from "utilities/url";
|
||||
|
||||
const DEFAULT_PAGE = 0;
|
||||
const DEFAULT_PAGE_SIZE = 8;
|
||||
@@ -17,9 +18,17 @@ export default {
|
||||
perPage = DEFAULT_PAGE_SIZE
|
||||
): Promise<IActivitiesResponse> => {
|
||||
const { ACTIVITIES } = endpoints;
|
||||
const pagination = `page=${page}&per_page=${perPage}`;
|
||||
const sort = `order_key=${ORDER_KEY}&order_direction=${ORDER_DIRECTION}`;
|
||||
const path = `${ACTIVITIES}?${pagination}&${sort}`;
|
||||
|
||||
const queryParams = {
|
||||
page,
|
||||
per_page: perPage,
|
||||
order_key: ORDER_KEY,
|
||||
order_direction: ORDER_DIRECTION,
|
||||
};
|
||||
|
||||
const queryString = buildQueryStringFromParams(queryParams);
|
||||
|
||||
const path = `${ACTIVITIES}?${queryString}`;
|
||||
|
||||
return sendRequest("GET", path);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user