From b0aec2cfd13065d46907cc678582fd4b91984760 Mon Sep 17 00:00:00 2001 From: E Date: Sun, 7 Mar 2021 20:56:20 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/api/index.ts | 6 +- client/src/index.tsx | 7 +-- client/src/pages/Dashboard.tsx | 3 + client/src/pages/Session.tsx | 87 ++++++++++++++-------------- client/src/pages/SessionPictures.tsx | 13 +++-- 5 files changed, 61 insertions(+), 55 deletions(-) diff --git a/client/src/api/index.ts b/client/src/api/index.ts index ffddb33..fb4c1bd 100644 --- a/client/src/api/index.ts +++ b/client/src/api/index.ts @@ -5,7 +5,7 @@ import settings from '../settings' const apiUrl = '/api' -export const createClient = async (body: Client) => { +export const createClient = async (body: Omit) => { await axios.post(`${apiUrl}/clients`, body) } @@ -20,12 +20,12 @@ export const getClient = async (id: string): Promise => { return res.data } export const startSession = async (clientId: string) => { - const res = await axios.post(`${apiUrl}/clients/${clientId}/session`) + const res = await axios.post(`${apiUrl}/clients/${clientId}`) return res.data // session data } export const killSession = async (clientId: string) => { - await axios.delete(`${apiUrl}/clients/${clientId}/session`) + await axios.delete(`${apiUrl}/clients/${clientId}`) } export const restartSession = async (clientId: string) => { diff --git a/client/src/index.tsx b/client/src/index.tsx index f66fdb4..248801e 100644 --- a/client/src/index.tsx +++ b/client/src/index.tsx @@ -5,12 +5,7 @@ import 'antd/dist/antd.css' import App from './App' import reportWebVitals from './reportWebVitals' -ReactDOM.render( - - - , - document.getElementById('root'), -) +ReactDOM.render(, document.getElementById('root')) // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log)) diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx index 439889c..adceed6 100644 --- a/client/src/pages/Dashboard.tsx +++ b/client/src/pages/Dashboard.tsx @@ -1,3 +1,4 @@ +import { message } from 'antd' import { Content } from 'antd/lib/layout/layout' import React, { FormEvent } from 'react' import { useState } from 'react' @@ -24,6 +25,7 @@ export const Dashboard = () => { if (phone.length < 10) { // helpful message + message.error('Check all fields!') setError('Phone number needs to be a length of at least 10') return } @@ -44,6 +46,7 @@ export const Dashboard = () => {