Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#48)feat/clerk auth #54

Merged
merged 5 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions gitlio/actions/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use server';
import axios from 'axios';

class UserNotFoundErr extends Error {}

export async function getIdAfterLogin(data: {
clerk_id: string;
email: string;
name: string | null;
}) {
const response = await axios.post(process.env.API_URL + 'users', data, {
headers: { 'Content-Type': 'application/json' },
});

console.log(response.data);
return response.data.user_id; // ๋ฐฑ์—”๋“œ์—์„œ userId๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค๊ณ  ๊ฐ€์ •
}

export async function getUserPortfolios(userId: string) {
const response = await axios.get(process.env.API_URL + 'users', {
params: { user_id: userId },
});

//console.log(response.data);
return response.data.portfolio; // ๋ฐฑ์—”๋“œ์—์„œ portfolios๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค๊ณ  ๊ฐ€์ •
}

export async function createPortfolio(data: {
user_id: string;
title: string;
domain_name: string;
}) {
const response = await axios.post(process.env.API_URL + 'portfolios/', data, {
headers: { 'Content-Type': 'application/json' },
});

console.log('ํฌํŠธํด๋ฆฌ์˜ค ์•„์ด๋””: ' + response.data.portfolio_id);
return response.data.portfolio_id; // ๋ฐฑ์—”๋“œ์—์„œ portfolioId๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค๊ณ  ๊ฐ€์ •
}
159 changes: 0 additions & 159 deletions gitlio/app/(edit)/experience/page.tsx

This file was deleted.

65 changes: 0 additions & 65 deletions gitlio/app/(edit)/introduction/page.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions gitlio/app/(edit)/layout.tsx

This file was deleted.

Loading