fix: use only slug (#7504)

* fix: use only slug

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* chore

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

* fix: create slug key

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>

---------

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
This commit is contained in:
Udit Takkar 2023-03-04 04:13:26 +05:30 committed by GitHub
parent 61a5c3a3b5
commit f3143d99ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View File

@ -637,7 +637,12 @@ const CTA = () => {
const profileOptions = query.data.profiles
.filter((profile) => !profile.readOnly)
.map((profile) => {
return { teamId: profile.teamId, label: profile.name || profile.slug, image: profile.image };
return {
teamId: profile.teamId,
label: profile.name || profile.slug,
image: profile.image,
slug: profile.slug,
};
});
return (

View File

@ -203,26 +203,26 @@ export default function CreateEventTypeDialog() {
message={form.formState.errors.schedulingType.message}
/>
)}
<RadioArea.Group className="flex mt-1 space-x-4">
<RadioArea.Group className="mt-1 flex space-x-4">
<RadioArea.Item
{...register("schedulingType")}
value={SchedulingType.COLLECTIVE}
className="w-1/2 text-sm">
<strong className="block mb-1">{t("collective")}</strong>
<strong className="mb-1 block">{t("collective")}</strong>
<p>{t("collective_description")}</p>
</RadioArea.Item>
<RadioArea.Item
{...register("schedulingType")}
value={SchedulingType.ROUND_ROBIN}
className="w-1/2 text-sm">
<strong className="block mb-1">{t("round_robin")}</strong>
<strong className="mb-1 block">{t("round_robin")}</strong>
<p>{t("round_robin_description")}</p>
</RadioArea.Item>
</RadioArea.Group>
</div>
)}
</div>
<div className="flex flex-row-reverse mt-8 gap-x-2">
<div className="mt-8 flex flex-row-reverse gap-x-2">
<Button type="submit" loading={createMutation.isLoading}>
{t("continue")}
</Button>

View File

@ -18,6 +18,7 @@ export interface Option {
teamId: number | null | undefined; // if undefined, then it's a profile
label: string | null;
image?: string | null;
slug: string | null;
}
interface CreateBtnProps {
@ -43,7 +44,7 @@ export function CreateButton(props: CreateBtnProps) {
const query = {
...router.query,
dialog: "new",
eventPage: option.label,
eventPage: option.slug,
teamId: option.teamId,
};
if (!option.teamId) {