mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: acitivity name bug
This commit is contained in:
parent
98d2d7cf83
commit
cf7cb0f35e
2 changed files with 4 additions and 3 deletions
|
|
@ -25,6 +25,7 @@ function ActivityElement(props: ActivitiyElementProps) {
|
|||
const router = useRouter();
|
||||
const [modifiedActivity, setModifiedActivity] = React.useState<ModifiedActivityInterface | undefined>(undefined);
|
||||
const [selectedActivity, setSelectedActivity] = React.useState<string | undefined>(undefined);
|
||||
const activityUUID = props.activity.activity_uuid;
|
||||
|
||||
async function deleteActivityUI() {
|
||||
await deleteActivity(props.activity.activity_uuid);
|
||||
|
|
@ -43,7 +44,7 @@ function ActivityElement(props: ActivitiyElementProps) {
|
|||
content: props.activity.content,
|
||||
}
|
||||
|
||||
await updateActivity(modifiedActivityCopy, activityId)
|
||||
await updateActivity(modifiedActivityCopy, activityUUID)
|
||||
mutate(`${getAPIUrl()}courses/${props.course_uuid}/meta`);
|
||||
await revalidateTags(['courses'], props.orgslug)
|
||||
router.refresh();
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ export async function getActivityWithAuthHeader(activity_uuid: any, next: any, a
|
|||
return res;
|
||||
}
|
||||
|
||||
export async function updateActivity(data: any, activity_id: any) {
|
||||
const result = await fetch(`${getAPIUrl()}activities/${activity_id}`, RequestBody("PUT", data, null));
|
||||
export async function updateActivity(data: any, activity_uuid: string) {
|
||||
const result = await fetch(`${getAPIUrl()}activities/${activity_uuid}`, RequestBody("PUT", data, null));
|
||||
const res = await result.json();
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue