fix: include user relation in scheme create, use raw UUID as id
This commit is contained in:
1252
origet/ test_output_202605240119.json
Normal file
1252
origet/ test_output_202605240119.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
origet/__pycache__/api_spec.cpython-313.pyc
Normal file
BIN
origet/__pycache__/api_spec.cpython-313.pyc
Normal file
Binary file not shown.
BIN
origet/__pycache__/client.cpython-313.pyc
Normal file
BIN
origet/__pycache__/client.cpython-313.pyc
Normal file
Binary file not shown.
BIN
origet/__pycache__/decrypt.cpython-313.pyc
Normal file
BIN
origet/__pycache__/decrypt.cpython-313.pyc
Normal file
Binary file not shown.
@@ -16,7 +16,7 @@ function sourceToType(source?: string): string {
|
||||
// 格式化方案卡片(对齐顶层 API)
|
||||
function formatScheme(s: any) {
|
||||
return {
|
||||
id: parseInt(s.id, 36) || String(s.id).split('-')[0] || s.id,
|
||||
id: s.id,
|
||||
user_id: s.userId,
|
||||
description: s.description || '',
|
||||
scheme_content: s.schemeContent || '',
|
||||
|
||||
@@ -10,7 +10,7 @@ const router = Router();
|
||||
|
||||
function formatScheme(s: any) {
|
||||
return {
|
||||
id: parseInt(s.id, 36) || String(s.id).split('-')[0] || s.id,
|
||||
id: s.id,
|
||||
user_id: s.userId,
|
||||
description: s.description || '',
|
||||
scheme_content: s.schemeContent || '',
|
||||
@@ -190,6 +190,9 @@ router.post('/', authMiddleware, async (req: Request, res: Response) => {
|
||||
price: priceNum,
|
||||
status: 'PUBLISHED',
|
||||
},
|
||||
include: {
|
||||
user: { select: { id: true, username: true, avatar: true } },
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.user.update({
|
||||
|
||||
@@ -8,7 +8,7 @@ const router = Router();
|
||||
|
||||
function formatScheme(s: any) {
|
||||
return {
|
||||
id: parseInt(s.id, 36) || String(s.id).split('-')[0] || s.id,
|
||||
id: s.id,
|
||||
user_id: s.userId,
|
||||
description: s.description || '',
|
||||
scheme_content: s.schemeContent || '',
|
||||
@@ -151,6 +151,9 @@ router.post('/', authMiddleware, async (req: Request, res: Response) => {
|
||||
schemeContent: body.scheme,
|
||||
status: 'PUBLISHED',
|
||||
},
|
||||
include: {
|
||||
user: { select: { id: true, username: true, avatar: true } },
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.user.update({
|
||||
|
||||
Reference in New Issue
Block a user