@speakr/speakr-module-services
Version:
SPEAKR Shared Service Module
51 lines (45 loc) • 1.56 kB
JavaScript
"use strict";
const db = require('../../db');
module.exports = function (options) {
return db.influencer_profiles.create({
first_name: options.first_name,
last_name: options.last_name,
email: options.email,
paypal_email: options.paypal_email,
second_email: options.second_email,
phone: options.phone,
country: options.country,
city: options.city,
state: options.state,
gender: options.gender,
birthday: options.birthday,
ethnicity: options.ethnicity,
ethnicity_other: options.ethnicity_other,
children: options.children,
occupation: options.occupation,
account_type: options.account_type,
relationship: options.relationship,
platforms: options.platforms,
strongestPlatforms: options.strongestPlatforms,
languages: options.languages,
pets: options.pets,
voice: options.voice,
min_likelyhood: options.min_likelyhood,
mediaType: options.mediaType,
important_factor: options.important_factor,
offer_price: options.offer_price,
content: options.content,
account_media_subject: options.account_media_subject,
min_price: options.min_price,
account_media_creator: options.account_media_creator,
influencer_id: options.influencers.id })
.then(influencer_profiles => {
if (!!influencer_profiles) {
options.influencer_profiles = influencer_profiles;
return Promise.resolve(options);
} else {
return Promise.reject("Influencer profile could not be created.");
}
}
);
};