This commit is contained in:
@@ -23,9 +23,14 @@ function preserveResponseId(rawText, payload) {
|
||||
if (!payload || typeof payload !== 'object' || !payload.data || typeof payload.data !== 'object') {
|
||||
return payload
|
||||
}
|
||||
const match = String(rawText || '').match(/"id"\s*:\s*"?(\d+)"?/)
|
||||
if (match && match[1]) {
|
||||
payload.data.id = match[1]
|
||||
const raw = String(rawText || '')
|
||||
const idMatch = raw.match(/"id"\s*:\s*"?(\d+)"?/)
|
||||
if (idMatch && idMatch[1]) {
|
||||
payload.data.id = idMatch[1]
|
||||
}
|
||||
const fileIdMatch = raw.match(/"fileId"\s*:\s*"?(\d+)"?/)
|
||||
if (fileIdMatch && fileIdMatch[1]) {
|
||||
payload.data.fileId = fileIdMatch[1]
|
||||
}
|
||||
return payload
|
||||
}
|
||||
@@ -110,6 +115,7 @@ function uploadProfileImage(filePath) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
uploadFile,
|
||||
chooseImageFilePath,
|
||||
uploadObjectFile,
|
||||
uploadProfileImage
|
||||
|
||||
Reference in New Issue
Block a user