mirror of
https://github.com/creativetimofficial/vue-material-kit.git
synced 2025-05-24 22:04:21 +08:00
Работает регистрация
Но это было вообще не просто
This commit is contained in:
parent
17638c259c
commit
06cfd96ce5
@ -346,6 +346,19 @@ watch(
|
|||||||
>Рассказ о том, какой я классный</span
|
>Рассказ о том, какой я классный</span
|
||||||
>
|
>
|
||||||
</a>
|
</a>
|
||||||
|
<a
|
||||||
|
class="dropdown-item py-2 ps-3 border-radius-md"
|
||||||
|
href="/CreateProject"
|
||||||
|
>
|
||||||
|
<h6
|
||||||
|
class="dropdown-header text-dark font-weight-bolder d-flex justify-content-cente align-items-center p-0"
|
||||||
|
>
|
||||||
|
Создать проект
|
||||||
|
</h6>
|
||||||
|
<span class="text-sm"
|
||||||
|
>Чтобы стать ещё более классным</span
|
||||||
|
>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,8 +42,17 @@ axios.interceptors.response.use((response) => {
|
|||||||
const createProject = async () => {
|
const createProject = async () => {
|
||||||
try {
|
try {
|
||||||
const headers = { 'Authorization': `Bearer ${token.value}` };
|
const headers = { 'Authorization': `Bearer ${token.value}` };
|
||||||
await axios.post('http://somebodyhire.me/api/projects/create/', projectData.value, { headers });
|
const data = {
|
||||||
router.push('/projects');
|
title: projectData.value.title,
|
||||||
|
description: projectData.value.description,
|
||||||
|
demo_link: projectData.value.demo_link,
|
||||||
|
source_link: projectData.value.source_link,
|
||||||
|
vote_total: projectData.value.vote_total,
|
||||||
|
vote_ratio: projectData.value.vote_ratio,
|
||||||
|
owner: userId.value
|
||||||
|
};
|
||||||
|
const response = await axios.post('http://somebodyhire.me/api/projects/create/', data, { headers });
|
||||||
|
router.push(`/project/${response.data.id}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
debugText.value = `Error: ${JSON.stringify(error, null, 2)}`;
|
debugText.value = `Error: ${JSON.stringify(error, null, 2)}`;
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user