Skip to content

Commit

Permalink
Fix loading pokestop name when editing quests
Browse files Browse the repository at this point in the history
  • Loading branch information
versx committed May 30, 2021
1 parent d875b17 commit 886bb88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/models/quest.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ Quest.init({
},
pokestopName: {
type: DataTypes.STRING(255),
allowNull: false,
allowNull: true,
},
reward: {
type: DataTypes.TEXT,
allowNull: false,
allowNull: true,
},
city: {
type: DataTypes.JSONTEXT,
Expand Down
4 changes: 2 additions & 2 deletions src/routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,12 +860,12 @@ router.post('/quests/new', async (req, res) => {

router.post('/quests/edit/:id', async (req, res) => {
const id = req.params.id;
const { guild_id, reward, pokestop_name, city, location, } = req.body;
const { guild_id, /*reward,*/ pokestop_name, city, location, } = req.body;
//const user_id = req.session.user_id;
const quest = await Quest.getById(id);
if (quest) {
const areas = getAreas(guild_id, (city || '').split(','));
quest.reward = reward;
//quest.reward = reward;
quest.pokestopName = pokestop_name;
quest.city = areas;
quest.location = location || null;
Expand Down
2 changes: 1 addition & 1 deletion src/views/invasions/edit.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="w-75" style="float: none; margin: 0 auto;">
<form action="/api/invasions/edit/{{id}}" method="post">
{{Pokestop Name}}
<input list="pokestop-names" class="custom-select" name="name" id="name">
<input list="pokestop-names" class="custom-select" name="name" id="name" value="{{name}}">
<datalist id="pokestop-names">
{{#pokestops}}
<option value="{{.}}">
Expand Down

0 comments on commit 886bb88

Please sign in to comment.