Fix:New authors not setting lastFirst column, updates for new Series model

This commit is contained in:
advplyr 2024-09-01 15:08:56 -05:00
parent 7ff72a8920
commit db86bfd63d
14 changed files with 234 additions and 225 deletions

View file

@ -1,4 +1,5 @@
const { DataTypes, Model, where, fn, col } = require('sequelize')
const parseNameString = require('../utils/parsers/parseNameString')
class Author extends Model {
constructor(values, options) {
@ -24,6 +25,16 @@ class Author extends Model {
this.createdAt
}
/**
*
* @param {string} name
* @returns {string}
*/
static getLastFirst(name) {
if (!name) return null
return parseNameString.nameToLastFirst(name)
}
/**
* Check if author exists
* @param {string} authorId