Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
jainefer committed Feb 29, 2024
1 parent de461c8 commit e0d92c8
Showing 1 changed file with 22 additions and 28 deletions.
50 changes: 22 additions & 28 deletions src/views/page/Projects/Docent/Mobile/DocentTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,8 @@ function DocentTitle() {
const location = useLocation();

const currentSubdomain = window.location.host.split(".")[0];
let teamId = location.state.teamId;

if (currentSubdomain === "m") {
if (location.state.teamId === null) {
teamId = 1;
}
} else if (currentSubdomain === "it") {
teamId = 2;
} else if (currentSubdomain === "ts") {
teamId = 3;
} else if (currentSubdomain === "vm") {
teamId = 4;
} else if (currentSubdomain === "dj") {
teamId = 5;
} else if (currentSubdomain === "os") {
teamId = 6;
}

console.log(teamId);

const [progress, setProgress] = useState(0);

const [title, setTitle] = useState("");
const [member, setMember] = useState([]);
const [background, setBackground] = useState("");

useEffect(() => {
let res;
let teamId = location.state ? location.state.teamId : null;;

if (currentSubdomain === "m") {
if (location.state.teamId === null) {
teamId = 1;
Expand All @@ -52,7 +26,27 @@ function DocentTitle() {
teamId = 5;
} else if (currentSubdomain === "os") {
teamId = 6;
}else{
teamId=2;
}






console.log(teamId);

const [progress, setProgress] = useState(0);

const [title, setTitle] = useState("");
const [member, setMember] = useState([]);
const [background, setBackground] = useState("");

useEffect(() => {

let res;

async function fetchData() {
res = await axios.get(
`https://api.clover-inarow.site/teams/${teamId}/docent`
Expand Down

0 comments on commit e0d92c8

Please sign in to comment.