Просмотр исходного кода

switched onboarding form submission to post request

jusrhee 4 лет назад
Родитель
Сommit
5caf3ed0fe
2 измененных файлов с 8 добавлено и 11 удалено
  1. 1 1
      dashboard/src/main/home/WelcomeForm.tsx
  2. 7 10
      dashboard/src/shared/api.tsx

+ 1 - 1
dashboard/src/main/home/WelcomeForm.tsx

@@ -22,7 +22,7 @@ const WelcomeForm: React.FunctionComponent<Props> = ({}) => {
 
   const submitForm = () => {
     api
-      .getWelcome(
+      .postWelcome(
         "<token>",
         {
           email: context.user && context.user.email,

+ 7 - 10
dashboard/src/shared/api.tsx

@@ -763,15 +763,12 @@ const getMetadata = baseApi<{}, {}>("GET", () => {
   return `/api/metadata`;
 });
 
-const getWelcome = baseApi<
-  {
-    email: string;
-    isCompany: boolean;
-    company: string;
-    role: string;
-  },
-  {}
->("GET", () => {
+const postWelcome = baseApi<{
+  email: string;
+  isCompany: boolean;
+  company: string;
+  role: string;
+}>("POST", () => {
   return `/api/welcome`;
 });
 
@@ -1085,7 +1082,7 @@ export default {
   getBranchContents,
   getBranches,
   getMetadata,
-  getWelcome,
+  postWelcome,
   getChart,
   getCharts,
   getChartComponents,