버그 수정, 모임장 설정 수정
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { ref, computed, onMounted, inject } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useToast } from 'primevue/usetoast';
|
||||
import clubService from '@/services/clubService';
|
||||
@@ -44,6 +44,7 @@ import axios from 'axios'
|
||||
const toast = useToast();
|
||||
const authStore = useAuthStore();
|
||||
const router = useRouter();
|
||||
const refreshSidebar = inject('refreshSidebar'); // App.vue에서 제공하는 사이드바 새로고침 메소드 주입
|
||||
|
||||
const clubName = ref('');
|
||||
const clubDescription = ref('');
|
||||
@@ -106,6 +107,16 @@ const handleCreateClub = async () => {
|
||||
// 성공 메시지
|
||||
toast.add({ severity: 'success', summary: '성공', detail: '클럽이 성공적으로 생성되었습니다.', life: 3000 });
|
||||
|
||||
// 사이드바 새로고침
|
||||
if (refreshSidebar) {
|
||||
try {
|
||||
await refreshSidebar();
|
||||
console.log('클럽 생성 후 사이드바 새로고침 완료');
|
||||
} catch (refreshError) {
|
||||
console.error('사이드바 새로고침 오류:', refreshError);
|
||||
}
|
||||
}
|
||||
|
||||
// 클럽 페이지로 이동
|
||||
router.push('/club');
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user