+import { isAbsolute, join } from 'path'
import { HttpStatusCode } from '@shared/core-utils'
+import { root } from '../miscs'
import {
makeDeleteRequest,
makeGetRequest,
})
}
+ protected updateImageRequest (options: InternalCommonCommandOptions & {
+ fixture: string
+ fieldname: string
+ }) {
+ let filePath = ''
+ if (isAbsolute(options.fixture)) {
+ filePath = options.fixture
+ } else {
+ filePath = join(root(), 'server', 'tests', 'fixtures', options.fixture)
+ }
+
+ return this.postUploadRequest({
+ ...options,
+
+ fields: {},
+ attaches: { [options.fieldname]: filePath }
+ })
+ }
+
private buildCommonRequestOptions (options: InternalCommonCommandOptions) {
const { path } = options