feat: add exploration scale list, questions, and scoring
Seed communication-style scale, expose /api/v1/scales APIs, and wire Explore/Scale H5 pages for the P1 探索测试 path. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -73,6 +73,20 @@ export function createClient(opts: CreateClientOptions) {
|
||||
method: 'POST',
|
||||
body: { profile_a_id, profile_b_id },
|
||||
}),
|
||||
listScales: () =>
|
||||
call<{ items: { slug: string; title: string; description: string }[] }>('/api/v1/scales'),
|
||||
getScale: (slug: string) =>
|
||||
call<{
|
||||
slug: string
|
||||
title: string
|
||||
description: string
|
||||
questions: { id: string; sort: number; body: { prompt: string; options: { key: string; text: string }[] } }[]
|
||||
}>(`/api/v1/scales/${slug}`),
|
||||
submitScale: (slug: string, profile_id: string, answers: Record<string, string>) =>
|
||||
call<{ id: string; result: Record<string, unknown> }>(`/api/v1/scales/${slug}/result`, {
|
||||
method: 'POST',
|
||||
body: { profile_id, answers },
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user