mirror of
https://github.com/wekan/wekan.git
synced 2026-03-03 04:10:16 +01:00
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration: - Add await before all ReactiveCache.getX() calls - Make functions containing ReactiveCache calls async - Convert forEach/map/filter loops with async callbacks to for...of - Update model helpers, Meteor methods, JsonRoutes handlers - Update collection hooks (.before/.after insert/update/remove) - Update .allow() callbacks to async Files updated across models/ and server/ directories: - Model files: cards, boards, lists, swimlanes, activities, users, checklists, checklistItems, customFields, attachments, integrations, cardComments, settings files, creators, exporters, and more - Server files: publications, methods, notifications, routes, migrations
This commit is contained in:
parent
2f6e34c5f5
commit
71eb01e233
81 changed files with 2218 additions and 2148 deletions
|
|
@ -13,14 +13,14 @@ import path from 'path';
|
|||
|
||||
if (Meteor.isServer) {
|
||||
// Handle avatar file downloads
|
||||
WebApp.connectHandlers.use('/cdn/storage/avatars/([^/]+)', (req, res, next) => {
|
||||
WebApp.connectHandlers.use('/cdn/storage/avatars/([^/]+)', async (req, res, next) => {
|
||||
if (req.method !== 'GET') {
|
||||
return next();
|
||||
}
|
||||
|
||||
try {
|
||||
const fileName = req.params[0];
|
||||
|
||||
|
||||
if (!fileName) {
|
||||
res.writeHead(400);
|
||||
res.end('Invalid avatar file name');
|
||||
|
|
@ -29,7 +29,7 @@ if (Meteor.isServer) {
|
|||
|
||||
// Extract file ID from filename (format: fileId-original-filename)
|
||||
const fileId = fileName.split('-original-')[0];
|
||||
|
||||
|
||||
if (!fileId) {
|
||||
res.writeHead(400);
|
||||
res.end('Invalid avatar file format');
|
||||
|
|
@ -37,7 +37,7 @@ if (Meteor.isServer) {
|
|||
}
|
||||
|
||||
// Get avatar file from database
|
||||
const avatar = ReactiveCache.getAvatar(fileId);
|
||||
const avatar = await ReactiveCache.getAvatar(fileId);
|
||||
if (!avatar) {
|
||||
res.writeHead(404);
|
||||
res.end('Avatar not found');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue