consistent profile image, initials with background color as backup, better profile image editing

This commit is contained in:
jackiettran
2025-12-12 23:08:54 -05:00
parent 3f319bfdd0
commit 55e08e14b8
11 changed files with 196 additions and 184 deletions

View File

@@ -91,7 +91,7 @@ router.get("/", async (req, res, next) => {
{
model: User,
as: "owner",
attributes: ["id", "firstName", "lastName"],
attributes: ["id", "firstName", "lastName", "imageFilename"],
},
],
limit: parseInt(limit),
@@ -175,7 +175,7 @@ router.get("/recommendations", authenticateToken, async (req, res, next) => {
router.get('/:id/reviews', async (req, res, next) => {
try {
const { Rental, User } = require('../models');
const reviews = await Rental.findAll({
where: {
itemId: req.params.id,
@@ -185,10 +185,10 @@ router.get('/:id/reviews', async (req, res, next) => {
itemReviewVisible: true
},
include: [
{
model: User,
as: 'renter',
attributes: ['id', 'firstName', 'lastName']
{
model: User,
as: 'renter',
attributes: ['id', 'firstName', 'lastName', 'imageFilename']
}
],
order: [['createdAt', 'DESC']]
@@ -228,7 +228,7 @@ router.get("/:id", optionalAuth, async (req, res, next) => {
{
model: User,
as: "owner",
attributes: ["id", "firstName", "lastName"],
attributes: ["id", "firstName", "lastName", "imageFilename"],
},
{
model: User,