Skip to content

Commit

Permalink
Merge pull request #629 from kunwar-11/minor-bug-fixes-in-event-sections
Browse files Browse the repository at this point in the history
fix: some minor bug fixes in event and admin blogs section
  • Loading branch information
jasirtp authored Dec 2, 2021
2 parents 9827990 + 4a3f8e7 commit 089880c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions component/admin/AdminNavbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Select from "react-select";
import styles from "../myblogs/blogs.module.scss";
import TagService from "../../services/TagService";
import notify from "../../lib/notify";
import { useRouter } from 'next/router'

export default function AdminNavbar({ changeTag, changeStatus, event }) {
const statusOptions = [
Expand All @@ -15,6 +16,8 @@ export default function AdminNavbar({ changeTag, changeStatus, event }) {
];
const [tagOptions, setTagOptions] = useState([]);

const router = useRouter()

useEffect(() => {
getSettingsTags();
}, []);
Expand Down Expand Up @@ -91,9 +94,9 @@ export default function AdminNavbar({ changeTag, changeStatus, event }) {
placeholder="Select Status"
// closeMenuOnSelect={false}
/>}
<div class="bg-black h-8 ml-4 hover:bg-white border border-black text-white hover:text-black hidden md:flex items-center text-sm font-semibold px-4 py-2 md:mr-3 rounded-sm cursor-pointer duration-700 blogs_h_40px__3sE3c">
{router.pathname.split('/')[2] === 'events' && <div class="bg-black h-8 ml-4 hover:bg-white border border-black text-white hover:text-black hidden md:flex items-center text-sm font-semibold px-4 py-2 md:mr-3 rounded-sm cursor-pointer duration-700 blogs_h_40px__3sE3c">
<a href="/admin/events/create-event">Create Event</a>
</div>
</div>}
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion pages/admin/events/create-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export async function getImageUrl(eventData, response) {
}

const validateForm = (eventDetails, setEventDetailsError) => {
let isValid = false;
let isValid = true;
if (eventDetails.organizerName.trim()) {
setEventDetailsError((prev) => ({ ...prev, organizerNameError: "" }));
} else {
Expand Down
2 changes: 1 addition & 1 deletion pages/admin/events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ const Admin = () => {
</div>
) : (
<div className="text-gray-700 text-center font-semibold mt-8">
Oops ! No posts!
Oops ! No Events!
</div>
)}
</div>
Expand Down
4 changes: 2 additions & 2 deletions services/EventService.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ async function createNewEvent(userCookie, eventData) {
})
if(response){
const res = await getImageUrl(eventData , response)
response = await updateEvent({
response = await updateEvent(response.data.data.id , {
guest_image : res[0],
banner_image : res[1]
}, response.data.data.id)
})
return response
}
} catch (err) {
Expand Down

0 comments on commit 089880c

Please sign in to comment.