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 e0d92c8 commit 639e002
Showing 1 changed file with 17 additions and 29 deletions.
46 changes: 17 additions & 29 deletions src/views/page/Projects/Podcast/Mobile/PodcastTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,10 @@ function PodcastTitle() {
const navigate = useNavigate();
const location = useLocation();


const currentSubdomain = window.location.host.split(".")[0];
let teamId = location.state.teamId;
console.log(currentSubdomain);
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 [teamName, setTeamName] = 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 @@ -54,7 +28,21 @@ function PodcastTitle() {
teamId = 5;
} else if (currentSubdomain === "os") {
teamId = 6;
}else{
teamId=2;
}
console.log(teamId);

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

const [title, setTitle] = useState("");
const [teamName, setTeamName] = 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}/podcast`
Expand Down

0 comments on commit 639e002

Please sign in to comment.