refactor: original changes

This commit is contained in:
Danny Avila 2025-05-30 04:28:22 -04:00
parent fa9177180f
commit f9c0e9853f
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
83 changed files with 413 additions and 505 deletions

View file

@ -1,9 +1,9 @@
const fs = require('fs');
const path = require('path');
const sharp = require('sharp');
const { updateUser } = require('@librechat/data-schemas');
const { resizeImageBuffer } = require('../images/resize');
const { updateFile } = require('~/models/File');
const db = require('~/lib/db/connectDb');
/**
* Converts an image file to the target format. The function first resizes the image based on the specified
@ -141,7 +141,7 @@ async function processLocalAvatar({ buffer, userId, manual }) {
let url = `${urlRoute}?manual=${isManual}`;
if (isManual) {
await db.models?.User.updateUser(userId, { avatar: url });
await updateUser(userId, { avatar: url });
}
return url;