mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-12 12:34:24 +01:00
refactor: original changes
This commit is contained in:
parent
fa9177180f
commit
f9c0e9853f
83 changed files with 413 additions and 505 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue