Add reputation actions endpoint: Implement getReputationActions method in FalukantService, update FalukantController to wrap the new method, and add corresponding route in falukantRouter for retrieving reputation actions.
This commit is contained in:
@@ -69,6 +69,7 @@ import Weather from '../models/falukant/data/weather.js';
|
||||
import TownProductWorth from '../models/falukant/data/town_product_worth.js';
|
||||
import ProductWeatherEffect from '../models/falukant/type/product_weather_effect.js';
|
||||
import WeatherType from '../models/falukant/type/weather.js';
|
||||
import ReputationActionType from '../models/falukant/type/reputation_action.js';
|
||||
|
||||
function calcAge(birthdate) {
|
||||
const b = new Date(birthdate); b.setHours(0, 0);
|
||||
@@ -3006,6 +3007,12 @@ class FalukantService extends BaseService {
|
||||
return TitleOfNobility.findAll();
|
||||
}
|
||||
|
||||
async getReputationActions() {
|
||||
return ReputationActionType.findAll({
|
||||
order: [['cost', 'ASC']]
|
||||
});
|
||||
}
|
||||
|
||||
async getHouseTypes() {
|
||||
// return House
|
||||
}
|
||||
@@ -3172,7 +3179,9 @@ class FalukantService extends BaseService {
|
||||
attributes: ['id']
|
||||
});
|
||||
if (already) {
|
||||
throw new Error('Diese Party wurde bereits innerhalb der letzten 24 Stunden bestellt');
|
||||
const error = new Error('Diese Party wurde bereits innerhalb der letzten 24 Stunden bestellt');
|
||||
error.status = 409;
|
||||
throw error;
|
||||
}
|
||||
const [ptype, music, banquette] = await Promise.all([
|
||||
PartyType.findByPk(partyTypeId),
|
||||
|
||||
Reference in New Issue
Block a user