-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: GetEvent, DeleteEvent 리팩토링
- Loading branch information
1 parent
41dd3d7
commit 28a33b8
Showing
5 changed files
with
49 additions
and
9 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,14 @@ | ||
import User from '../../entity/User'; | ||
import Event from '../../entity/Event'; | ||
|
||
class DeleteEvent { | ||
async deleteEvent(eventId: string): Promise<string> { | ||
const eventIdStr2Num = parseInt(eventId) | ||
await Event.delete({ | ||
id: eventIdStr2Num | ||
}); | ||
return ; | ||
} | ||
} | ||
|
||
export default new DeleteEvent(); |
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,25 @@ | ||
import User from '../../entity/User'; | ||
import Event from '../../entity/Event'; | ||
import Comment from "../../entity/Comment"; | ||
import {JoinOptions} from "typeorm/find-options/JoinOptions"; | ||
import {number} from "zod"; | ||
|
||
|
||
|
||
class GetEvent { | ||
async getEvent(eventId: string): Promise<Event> { | ||
const eventIdStr2Num = parseInt(eventId) | ||
const getEvent = await Event.findOne({where: {id: eventIdStr2Num}}); | ||
return getEvent; | ||
} | ||
} | ||
|
||
export default new GetEvent(); | ||
|
||
|
||
// 조인 옵션 내일 할게용 | ||
// join?: JoinOptions; | ||
// | ||
// innerJoinAndSelect?: { | ||
// [key: string]: string; | ||
// }; |