TypeError: Garage.getUsercarlists is not a function

#1

Hi there
Maybe you guys can help me out with this.
My project requires a user to login and view playlists and then add new playlists.
I can login as users but it crashes when i try to go to the dashboard(to view the playlists).
i get an error TypeError: Garage.getUsercarlists is not a function

heres the code from dashboard.js

‘use strict’;

const accounts = require (’./accounts.js’);
const logger = require(’…/utils/logger’);
const Garage = require(’…/models/Car-store’);
const uuid = require(‘uuid’);

const dashboard = {
index(request, response) {
logger.info(‘dashboard rendering’);
const loggedInUser = accounts.getCurrentUser(request);
if (loggedInUser) {
const viewData = {
title: ‘carlist Dashboard’,
carlist: Garage.getUsercarlists(loggedInUser.id),
fullname: loggedInUser.firstName + ’ ’ + loggedInUser.lastName,
};
logger.info(‘about to render’, viewData.carlists);
response.render(‘dashboard’, viewData);
}
else response.redirect(’/’);
},

deletegarage(request, response) {
const carlistId = request.params.id;
logger.debug(‘Deleting carlist ${carlistId}’);
Garage.removecarlist(carlistId);
response.redirect(’/dashboard’);
},
addcarlist(request, response) {
const loggedInUser = accounts.getCurrentUser(request);
const newcarList = {
id: uuid(),
userid: loggedInUser.id,
title: request.body.title,
songs: ,
};
logger.debug(‘Creating a new carlist’, newcarList);
Garage.addcarlist(newcarList);
response.redirect(’/dashboard’);
},

};

module.exports = dashboard;