upd
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
# VITE_API_URL=http://localhost:3001
|
||||
VITE_API_URL=http://192.168.1.171:3001
|
||||
# VITE_API_URL=https://crm.stream.graff.tech/api
|
||||
# VITE_API_URL=http://192.168.1.171:3001
|
||||
VITE_API_URL=https://crm.stream.graff.tech/api
|
||||
VITE_STREAM_URL=https://stream.graff.tech
|
||||
|
||||
@@ -60,7 +60,7 @@ function Card({
|
||||
}, [isShow]);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="relative flex flex-col gap-2">
|
||||
<div className="w-[264px] h-[164px] px-3 py-2 bg-white border-r border-b border-[#DAE0E5] flex flex-col justify-between gap-2">
|
||||
<div className="space-y-2">
|
||||
<div className="flex justify-between">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { isAfter } from "date-fns";
|
||||
import useModalStore from "../stores/useModalStore";
|
||||
import Button from "./Button";
|
||||
import PlusIcon from "./icons/PlusIcon";
|
||||
@@ -15,22 +16,24 @@ function EmptyCard({ buildId, startAt, duration }: Props) {
|
||||
|
||||
return (
|
||||
<div className="w-[264px] h-[164px] text-sm font-semibold bg-[#F0F1F2] border-r border-b border-[#DAE0E5] flex items-center justify-center group">
|
||||
<Button
|
||||
color="tertiary"
|
||||
icon={<PlusIcon />}
|
||||
className="group-hover:opacity-100 opacity-0"
|
||||
handleClick={() =>
|
||||
setModal(
|
||||
<CreateScheduledSessionModal
|
||||
buildId={buildId}
|
||||
startAt={startAt}
|
||||
duration={duration}
|
||||
/>
|
||||
)
|
||||
}
|
||||
>
|
||||
Добавить сеанс
|
||||
</Button>
|
||||
{isAfter(startAt, new Date()) && (
|
||||
<Button
|
||||
color="tertiary"
|
||||
icon={<PlusIcon />}
|
||||
className="group-hover:opacity-100 opacity-0"
|
||||
handleClick={() =>
|
||||
setModal(
|
||||
<CreateScheduledSessionModal
|
||||
buildId={buildId}
|
||||
startAt={startAt}
|
||||
duration={duration}
|
||||
/>
|
||||
)
|
||||
}
|
||||
>
|
||||
Добавить сеанс
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ function Managers() {
|
||||
{isShowManagers && (
|
||||
<div className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
{managers?.map((manager) => (
|
||||
{managers.map((manager) => (
|
||||
<div key={manager.id} className="flex justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<img
|
||||
|
||||
@@ -45,8 +45,6 @@ function CreateScheduleModal() {
|
||||
|
||||
if (!result || !result.startAt) return;
|
||||
|
||||
console.log("result.startAt", result.startAt);
|
||||
|
||||
setStartDate(startOfDay(parseISO(result.startAt)));
|
||||
} catch (error) {
|
||||
alert((error as Error).message);
|
||||
@@ -144,7 +142,7 @@ function CreateScheduleModal() {
|
||||
<DatePicker
|
||||
defaultValue={addDays(startDate, 1)}
|
||||
startDate={addDays(startDate, 1)}
|
||||
onChange={(date) => (setDate(date), console.log(date))}
|
||||
onChange={(date) => setDate(date)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@ function CreateScheduledSessionModal({ buildId, startAt, duration }: Props) {
|
||||
setIsLoading(true);
|
||||
|
||||
try {
|
||||
const result = await api
|
||||
await api
|
||||
.post(`scheduled_sessions`, {
|
||||
json: {
|
||||
buildId,
|
||||
@@ -41,8 +41,6 @@ function CreateScheduledSessionModal({ buildId, startAt, duration }: Props) {
|
||||
},
|
||||
})
|
||||
.json();
|
||||
|
||||
console.log("result", result);
|
||||
} catch (error) {
|
||||
alert((error as Error).message);
|
||||
}
|
||||
|
||||
@@ -254,8 +254,6 @@ function DashboardPage() {
|
||||
async function getSchedules() {
|
||||
if (!company || !selectedBuild) return;
|
||||
|
||||
console.log("selectedBuild.id", selectedBuild.id);
|
||||
|
||||
const result: any[] = await api
|
||||
.get(`companies/${company.id}/builds/${selectedBuild.id}/schedules`)
|
||||
.json();
|
||||
@@ -300,7 +298,7 @@ function DashboardPage() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!company || !selectedBuild) return;
|
||||
console.log("selectedBuild", selectedBuild);
|
||||
|
||||
getSchedules();
|
||||
getManagers();
|
||||
}, [selectedBuild]);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import ky from "ky";
|
||||
import ReCAPTCHA from "react-google-recaptcha";
|
||||
// import ReCAPTCHA from "react-google-recaptcha";
|
||||
import Form from "../components/Form";
|
||||
import Label from "../components/Label";
|
||||
import Input from "../components/Input";
|
||||
@@ -13,7 +13,7 @@ import useAuthStore from "../stores/useAuthStore";
|
||||
function LoginPage() {
|
||||
const [username, setUsername] = useState<string>();
|
||||
const [password, setPassword] = useState<string>();
|
||||
const recaptchaRef = useRef(null);
|
||||
// const recaptchaRef = useRef(null);
|
||||
const [accessToken, setAccessToken, setUser] = useAuthStore((state) => [
|
||||
state.accessToken,
|
||||
state.setAccessToken,
|
||||
@@ -79,11 +79,11 @@ function LoginPage() {
|
||||
handleChange={(value) => setPassword(value)}
|
||||
/>
|
||||
</div>
|
||||
<ReCAPTCHA
|
||||
{/* <ReCAPTCHA
|
||||
ref={recaptchaRef}
|
||||
sitekey="6LdKPH4oAAAAAM8cyMoCkmNvbnBbe2UIrwRwQ425"
|
||||
className="mt-3"
|
||||
/>
|
||||
/> */}
|
||||
<Button
|
||||
type="submit"
|
||||
size="medium"
|
||||
|
||||
@@ -7,7 +7,7 @@ import Token from "../models/Token";
|
||||
const router = Router();
|
||||
|
||||
router.post("/", async (req, res) => {
|
||||
const { username, password } = req.body;
|
||||
let { username, password } = req.body;
|
||||
|
||||
if (!username || !password) {
|
||||
return res.json({
|
||||
@@ -15,6 +15,8 @@ router.post("/", async (req, res) => {
|
||||
});
|
||||
}
|
||||
|
||||
username = username.toLowerCase();
|
||||
|
||||
const user = await User.findOne({ username });
|
||||
|
||||
if (!user) {
|
||||
|
||||
@@ -76,8 +76,6 @@ router.get("/:buildId", async (req, res) => {
|
||||
router.post("/", async (req, res) => {
|
||||
const { buildId, startAt, client, duration } = req.body;
|
||||
|
||||
console.log("client", client);
|
||||
|
||||
if (!buildId || !startAt) {
|
||||
return res.json({
|
||||
status: "error",
|
||||
|
||||
Reference in New Issue
Block a user