fix: improve cache management and sticker deletion
Update cache directory scanning to use platform-specific paths for iOS and Android. Add a delay after clearing cache to ensure native deletion completes. Correct the request body structure for sticker deletion API calls.
This commit is contained in:
@@ -85,9 +85,8 @@ export const addStickerFromUrl = async (
|
||||
*/
|
||||
export const deleteSticker = async (stickerId: string): Promise<boolean> => {
|
||||
try {
|
||||
await api.delete('/stickers', {
|
||||
data: { sticker_id: stickerId },
|
||||
});
|
||||
// api.delete(path, body) 的第二个参数直接作为请求体,不需要 axios 风格的 { data } 包装
|
||||
await api.delete('/stickers', { sticker_id: stickerId });
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error('删除自定义表情失败:', error);
|
||||
@@ -130,9 +129,7 @@ export const batchDeleteStickers = async (stickerIds: string[]): Promise<{ succe
|
||||
|
||||
for (const stickerId of stickerIds) {
|
||||
try {
|
||||
await api.delete('/stickers', {
|
||||
data: { sticker_id: stickerId },
|
||||
});
|
||||
await api.delete('/stickers', { sticker_id: stickerId });
|
||||
success++;
|
||||
} catch (error) {
|
||||
console.error(`删除表情 ${stickerId} 失败:`, error);
|
||||
|
||||
Reference in New Issue
Block a user