-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: InviteInfo 테이블 추가 * feat: 초대권 생성 기능 구현 * feat: trpcModule, userModule에 inviteModule 추가 * feat: 회원가입시 초대권 생성 코드 추가 * chore: 코드 포맷팅 및 console.log 제거 * chore: 줄 띄어쓰기 추가 * feat: 내 초대권 조회 기능 추가 * feat: trpc router에 InviteController 연결 * feat: controller에서 사용하는 모듈들을 상대경로로 import 변경 * client에서 사용할 때, trpc에서 invite router의 타입을 any로 잡혀서 상대경로로 변경 * feat: 내 초대권 조회 기능 테스트 추가 * feat: code를 uid에서 랜덤 6자로 변경 * refactor: 불필요한 기본값 설정 제거 * refactor: 초대한 수 기록하는 변수에 기본값 설정 제거 * wip migration 필요해서 브랜치를 옮기기 위한 커밋 * feat: add user type for non invite user * [#46] 초대권 생성 기능 구현 (#48) * feat: InviteInfo 테이블 추가 * feat: 초대권 생성 기능 구현 * feat: trpcModule, userModule에 inviteModule 추가 * feat: 회원가입시 초대권 생성 코드 추가 * chore: 코드 포맷팅 및 console.log 제거 * chore: 줄 띄어쓰기 추가 * feat: 내 초대권 조회 기능 추가 * feat: trpc router에 InviteController 연결 * feat: controller에서 사용하는 모듈들을 상대경로로 import 변경 * client에서 사용할 때, trpc에서 invite router의 타입을 any로 잡혀서 상대경로로 변경 * feat: 내 초대권 조회 기능 테스트 추가 * feat: code를 uid에서 랜덤 6자로 변경 * refactor: 불필요한 기본값 설정 제거 * refactor: 초대한 수 기록하는 변수에 기본값 설정 제거 * feat: add user type for non invite user * fix: default userType변경 및 inviteCode에 unique 추가 * fix: default userType변경 및 inviteCode에 unique 추가 * fix: inviteUser 테이블에 User relation연결 schema상에서만 연결처럼 보이고 실제 db에서는 연결 안됨 실제 연결시키려면 schema.prisma에서 relationMode를 foreignKeys로 설정해야함 * fix: inviteUser 테이블에 User relation연결 schema상에서만 연결처럼 보이고 실제 db에서는 연결 안됨 실제 연결시키려면 schema.prisma에서 relationMode를 foreignKeys로 설정해야함 * feat: ctx에 user 타입 캐스팅 해두기 #50 * feat: add inviteRecord table * feat: add inviteRecord table * fix: 연결관계 추가 및 인덱스 추가 * fix: 연결관계 추가 및 인덱스 추가 * fix: test * fix: test * wip * fix: 회원가입 시 초대권이 생성되지 않고, 초대 시 생성되도록 변경 * feat: 클립보드 라이브러리 추가 및 패키지 고정 * feat: 초대 승인 기능 * fix: 코드 수정 * fix: default 설정을 받을 수 있는 * wip --------- Co-authored-by: yoon-junseo <[email protected]> Co-authored-by: bongsu-rapportlabs <[email protected]>
- Loading branch information
1 parent
74fe8df
commit 1d29da1
Showing
29 changed files
with
7,827 additions
and
10,016 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const withInvite = { | ||
bottomSheet: () => {}, | ||
redirectScreen: () => {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const withLogin = { | ||
bottomSheet: () => {}, | ||
redirectScreen: () => {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// TODO 로그인 유저 정보 물고있기 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { trpc } from './../trpc/index' | ||
import { create } from 'zustand' | ||
import { User } from '@pinit/server/src/prisma/dto' | ||
|
||
type UserStore = { | ||
_user?: User | ||
user: User | ||
ininUser: () => Promise<void> | ||
} | ||
|
||
export const useUser = create<UserStore>()((set, get) => ({ | ||
_user: undefined, | ||
user: (() => { | ||
const _user = get()._user | ||
if (!_user) { | ||
get().ininUser() | ||
throw new Error('user가 없습니다.') | ||
} | ||
|
||
return _user | ||
})(), | ||
ininUser: async () => { | ||
const user = await trpc.user.getUser.query() | ||
set({ user }) | ||
}, | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
apps/server/prisma/migrations/20240622141207_add_user_type_for_non_invited/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE `User` MODIFY `type` ENUM('USER_NOT_INVITED', 'USER', 'ADMIN') NOT NULL DEFAULT 'USER'; |
11 changes: 11 additions & 0 deletions
11
...ations/20240622145630_chagne_default_usertype_and_add_unique_on_invite_code/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
Warnings: | ||
- A unique constraint covering the columns `[code]` on the table `InviteInfo` will be added. If there are existing duplicate values, this will fail. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE `User` MODIFY `type` ENUM('USER_NOT_INVITED', 'USER', 'ADMIN') NOT NULL DEFAULT 'USER_NOT_INVITED'; | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX `InviteInfo_code_key` ON `InviteInfo`(`code`); |
9 changes: 9 additions & 0 deletions
9
apps/server/prisma/migrations/20240622154157_add_invite_record/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- CreateTable | ||
CREATE TABLE `InviteRecord` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`inviteeUid` VARCHAR(191) NOT NULL, | ||
`inviterUid` VARCHAR(191) NOT NULL, | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; |
17 changes: 17 additions & 0 deletions
17
...ver/prisma/migrations/20240622155346_relation_on_invite_info_to_invite_tier/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- DropIndex | ||
DROP INDEX `InviteTier_tier_key` ON `InviteTier`; | ||
|
||
-- AlterTable | ||
ALTER TABLE `InviteTier` ADD PRIMARY KEY (`tier`); | ||
|
||
-- CreateIndex | ||
CREATE INDEX `InviteInfo_tier_idx` ON `InviteInfo`(`tier`); | ||
|
||
-- CreateIndex | ||
CREATE INDEX `InviteInfo_code_idx` ON `InviteInfo`(`code`); | ||
|
||
-- CreateIndex | ||
CREATE INDEX `InviteInfo_uid_idx` ON `InviteInfo`(`uid`); | ||
|
||
-- CreateIndex | ||
CREATE INDEX `InviteTier_tier_idx` ON `InviteTier`(`tier`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Controller, Get } from '@nestjs/common' | ||
import { TRPCError } from '@trpc/server' | ||
|
||
@Controller('/') | ||
export class AppController { | ||
@Get('/') | ||
async test() { | ||
return 'hello world' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.