mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-21 15:53:50 +02:00
refactor: Organize Project Structure (#1211)
* refactor: Organize Project Structure * fix * fix * rm security * fix
This commit is contained in:
66
src/api/vrcPlusIcon.js
Normal file
66
src/api/vrcPlusIcon.js
Normal file
@@ -0,0 +1,66 @@
|
||||
// #region | App: VRCPlus Icons
|
||||
|
||||
const VRCPlusIconsReq = {
|
||||
getFileList(params) {
|
||||
return window.API.call('files', {
|
||||
method: 'GET',
|
||||
params
|
||||
}).then((json) => {
|
||||
const args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
window.API.$emit('FILES:LIST', args);
|
||||
return args;
|
||||
});
|
||||
},
|
||||
|
||||
deleteFile(fileId) {
|
||||
return window.API.call(`file/${fileId}`, {
|
||||
method: 'DELETE'
|
||||
}).then((json) => {
|
||||
const args = {
|
||||
json,
|
||||
fileId
|
||||
};
|
||||
return args;
|
||||
});
|
||||
},
|
||||
|
||||
uploadVRCPlusIcon(imageData) {
|
||||
const params = {
|
||||
tag: 'icon'
|
||||
};
|
||||
return window.API.call('file/image', {
|
||||
uploadImage: true,
|
||||
matchingDimensions: true,
|
||||
postData: JSON.stringify(params),
|
||||
imageData
|
||||
}).then((json) => {
|
||||
const args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
window.API.$emit('VRCPLUSICON:ADD', args);
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
||||
// unused
|
||||
// images.pug line 63
|
||||
// deleteFileVersion(params) {
|
||||
// return window.API.call(`file/${params.fileId}/${params.version}`, {
|
||||
// method: 'DELETE'
|
||||
// }).then((json) => {
|
||||
// const args = {
|
||||
// json,
|
||||
// params
|
||||
// };
|
||||
// return args;
|
||||
// });
|
||||
// }
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
export default VRCPlusIconsReq;
|
||||
Reference in New Issue
Block a user