기능구현중
This commit is contained in:
28
server/api/google-group/list.get.ts
Normal file
28
server/api/google-group/list.get.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { query } from '../../utils/db'
|
||||
import { requireAuth } from '../../utils/session'
|
||||
|
||||
/**
|
||||
* 구글 그룹 목록 조회
|
||||
* GET /api/google-group/list
|
||||
*/
|
||||
export default defineEventHandler(async (event) => {
|
||||
await requireAuth(event)
|
||||
|
||||
const groups = await query(`
|
||||
SELECT group_id, group_email, group_name, description, is_active, created_at
|
||||
FROM wr_google_group
|
||||
WHERE is_active = true
|
||||
ORDER BY group_name
|
||||
`)
|
||||
|
||||
return {
|
||||
groups: groups.map(g => ({
|
||||
groupId: g.group_id,
|
||||
groupEmail: g.group_email,
|
||||
groupName: g.group_name,
|
||||
description: g.description,
|
||||
isActive: g.is_active,
|
||||
createdAt: g.created_at
|
||||
}))
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user