Skip to content

Commit

Permalink
fix: (Transcoding) Set resource reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Oct 31, 2023
1 parent ddfd17e commit 2c4238a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
13 changes: 2 additions & 11 deletions src/api/ADempiere/logs/tabInfo/windowAttachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,13 @@ export function requestAttachment({
* @param {string} resourceName as fileName
* @returns {promise}
*/
export function setResourceReference({
export function requestSetResourceReference({
id,
uuid,
//
resourceType = RESOURCE_TYPE_ATTACHMENT,
resourceId,
//
tableName,
recordId,
recordUuid,
//
textMessage,
fileName,
Expand All @@ -74,15 +71,9 @@ export function setResourceReference({
url: `/file-management/references/attachment/${tableName}/${recordId}`,
method: 'put',
data: {
id,
uuid,
// parent values (attachment, image, archive)
resource_type: resourceType,
// resource_id: resourceId,
// attachment values
// table_name: tableName,
record_id: recordId,
record_uuid: recordUuid,
id,
// attachment reference values
text_message: textMessage,
file_name: fileName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ import { RESOURCE_TYPE_ATTACHMENT } from '@/utils/ADempiere/resource'

// API Request Methods
// import {
// // requestUploadAttachment,
// setResourceReference
// // requestUploadAttachment
// } from '@/api/ADempiere/user-interface/component/resource'
import {
setResourceReference
requestSetResourceReference
} from '@/api/ADempiere/logs/tabInfo/windowAttachment.ts'

// Utils and Helper Methods
Expand Down Expand Up @@ -108,11 +107,10 @@ export default defineComponent({

function isValidUploadHandler(file) {
return new Promise((resolve, reject) => {
setResourceReference({
requestSetResourceReference({
resourceType: RESOURCE_TYPE_ATTACHMENT,
tableName: props.tableName,
recordId: props.recordId,
recordUuid: props.recordUuid,
fileName: file.name,
fileSize: file.size
}).then(response => {
Expand All @@ -123,7 +121,8 @@ export default defineComponent({

fileResource.value = response
additionalData.value = {
resource_uuid: response.uuid,
// resource_uuid: response.uuid,
id: response.id,
file_name: response.file_name
}
resolve(true)
Expand Down

0 comments on commit 2c4238a

Please sign in to comment.