feat: 1. 完善起草合同页面的逻辑交互,对接minio的接口操作
This commit is contained in:
@@ -90,7 +90,7 @@ async function safeGetJWT(jwtToken?: string): Promise<string> {
|
||||
*/
|
||||
export async function findIsProposer(taskId: string | number, userId: number | undefined, frontendJWT?: string): Promise<boolean> {
|
||||
// 通过postgrest的get请求去cross_examination_tasks表中进行查找assignee_id是否等于userId
|
||||
const response = await postgrestGet(`cross_examination_tasks`, {
|
||||
const response = await postgrestGet(`/api/postgrest/proxy/cross_examination_tasks`, {
|
||||
select: 'assigner_id',
|
||||
filter: {
|
||||
id: `eq.${taskId}`
|
||||
@@ -399,7 +399,7 @@ export async function confirmReviewResults(
|
||||
): Promise<{data?: unknown, error?: string, status?: number}> {
|
||||
try {
|
||||
// 通过postgrest的post请求去documents表中进行查找id等于documentId的数据,更新documents表的audit_status为1
|
||||
const response = await postgrestPut(`documents`, {
|
||||
const response = await postgrestPut(`/api/postgrest/proxy/documents`, {
|
||||
audit_status: 1
|
||||
}, {
|
||||
id: documentId
|
||||
|
||||
@@ -494,7 +494,7 @@ export async function updateDocumentAuditStatus(id: string, auditStatus: number,
|
||||
}
|
||||
|
||||
const response = await postgrestPut<TaskDocument, Partial<TaskDocument>>(
|
||||
'documents',
|
||||
'/api/postgrest/proxy/documents',
|
||||
{ audit_status: auditStatus },
|
||||
{
|
||||
id: parseInt(id)
|
||||
@@ -526,7 +526,7 @@ export async function getCrossCheckingDocumentTypes(jwtToken?: string): Promise<
|
||||
try {
|
||||
// console.log('[getCrossCheckingDocumentTypes] 开始获取交叉评查文档类型');
|
||||
|
||||
const response = await postgrestGet<DocumentType>('document_types',{
|
||||
const response = await postgrestGet<DocumentType>('/api/postgrest/proxy/document_types',{
|
||||
select: 'id,name,code,evaluation_point_groups_ids',
|
||||
filter: {
|
||||
evaluation_point_groups_ids: 'not.is.null'
|
||||
|
||||
@@ -34,7 +34,7 @@ export async function verifyDocumentAccess(
|
||||
|
||||
try {
|
||||
// 1. 检查文档是否属于该任务(通过 cross_task_document_mapping 表)
|
||||
const documentMappingResponse = await postgrestGet('cross_task_document_mapping', {
|
||||
const documentMappingResponse = await postgrestGet('/api/postgrest/proxy/cross_task_document_mapping', {
|
||||
select: 'task_id,document_id',
|
||||
filter: {
|
||||
task_id: `eq.${taskId}`,
|
||||
@@ -66,7 +66,7 @@ export async function verifyDocumentAccess(
|
||||
}
|
||||
|
||||
// 2. 检查用户是否是该任务的参与者
|
||||
const taskResponse = await postgrestGet('cross_examination_tasks', {
|
||||
const taskResponse = await postgrestGet('/api/postgrest/proxy/cross_examination_tasks', {
|
||||
select: 'assigner_id,assignee_ids',
|
||||
filter: {
|
||||
id: `eq.${taskId}`
|
||||
|
||||
Reference in New Issue
Block a user