refactor: Organize Project Structure (#1211)

* refactor: Organize Project Structure

* fix

* fix

* rm security

* fix
This commit is contained in:
pa
2025-04-18 15:04:03 +09:00
committed by GitHub
parent 59d3ead781
commit 6bda44be52
106 changed files with 172 additions and 165 deletions

126
src/api/vrcPlusImage.js Normal file
View File

@@ -0,0 +1,126 @@
const vrcPlusImageReq = {
uploadGalleryImage(imageData) {
const params = {
tag: 'gallery'
};
return window.API.call('file/image', {
uploadImage: true,
matchingDimensions: false,
postData: JSON.stringify(params),
imageData
}).then((json) => {
const args = {
json,
params
};
window.API.$emit('GALLERYIMAGE:ADD', args);
return args;
});
},
uploadSticker(imageData, params) {
return window.API.call('file/image', {
uploadImage: true,
matchingDimensions: true,
postData: JSON.stringify(params),
imageData
}).then((json) => {
const args = {
json,
params
};
window.API.$emit('STICKER:ADD', args);
return args;
});
},
getPrints(params) {
return window.API.call(`prints/user/${window.API.currentUser.id}`, {
method: 'GET',
params
}).then((json) => {
const args = {
json,
params
};
window.API.$emit('PRINT:LIST', args);
return args;
});
},
deletePrint(printId) {
return window.API.call(`prints/${printId}`, {
method: 'DELETE'
}).then((json) => {
const args = {
json,
printId
};
window.API.$emit('PRINT:DELETE', args);
return args;
});
},
uploadPrint(imageData, cropWhiteBorder, params) {
return window.API.call('prints', {
uploadImagePrint: true,
cropWhiteBorder,
postData: JSON.stringify(params),
imageData
}).then((json) => {
const args = {
json,
params
};
window.API.$emit('PRINT:ADD', args);
return args;
});
},
getPrint(params) {
return window.API.call(`prints/${params.printId}`, {
method: 'GET'
}).then((json) => {
const args = {
json,
params
};
window.API.$emit('PRINT', args);
return args;
});
},
uploadEmoji(imageData, params) {
return window.API.call('file/image', {
uploadImage: true,
matchingDimensions: true,
postData: JSON.stringify(params),
imageData
}).then((json) => {
const args = {
json,
params
};
window.API.$emit('EMOJI:ADD', args);
return args;
});
}
// ----------- no place uses this function ------------
// editPrint(params) {
// return window.API.call(`prints/${params.printId}`, {
// method: 'POST',
// params
// }).then((json) => {
// const args = {
// json,
// params
// };
// window.API.$emit('PRINT:EDIT', args);
// return args;
// });
// },
};
export default vrcPlusImageReq;