mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
advanced address parsing
This commit is contained in:
parent
ea08ab8a5e
commit
89a13f1475
5 changed files with 82 additions and 19 deletions
|
@ -1,6 +1,6 @@
|
|||
const { User, Route } = require('../../models');
|
||||
|
||||
const { parseRoute, parseStickers, parseString, parseNumber } = require('../../utils/parse');
|
||||
const { parseRoute, parseStickers, parseString, parseNumber, parseAddress } = require('../../utils/parse');
|
||||
|
||||
module.exports = async (req, res) => {
|
||||
const { body, body: { id, token, force } } = req;
|
||||
|
@ -9,7 +9,7 @@ module.exports = async (req, res) => {
|
|||
if (!owner) return res.send({ success: false, reason: 'unauthorized', id, token });
|
||||
|
||||
const title = parseString(body.title, 64);
|
||||
const address = parseString(body.address, 32);
|
||||
const address = parseAddress(body.address, 32)
|
||||
const route = parseRoute(body.route);
|
||||
const stickers = parseStickers(body.stickers);
|
||||
const logo = parseString(body.logo, 16);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue