mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
first import attempts
This commit is contained in:
parent
8da254ff9b
commit
f7e8da1f1f
9 changed files with 57 additions and 6 deletions
|
@ -7,7 +7,7 @@ const report = console.warn;
|
|||
export const checkUserToken = ({
|
||||
callback, fallback, id, token
|
||||
}) => (
|
||||
axios.get(API.GET_GUEST, {
|
||||
axios.get(API.CHECK_TOKEN, {
|
||||
params: { action: 'check_token', id, token }
|
||||
})
|
||||
.then(result => (result && result.data))
|
||||
|
@ -31,3 +31,13 @@ export const getMergedImage = ({ placement, callback }) => (
|
|||
.then(callback)
|
||||
.catch(report)
|
||||
);
|
||||
|
||||
export const getStoredMap = ({ name, callback }) => (
|
||||
axios.get(API.GET_MAP, {
|
||||
params: { name, action: 'load' }
|
||||
})
|
||||
.then(result => (result && result.data &&result.data.data))
|
||||
.then(data => ({ ...data }))
|
||||
.then(callback)
|
||||
.catch(report)
|
||||
)
|
||||
|
|
2
src/utils/history.js
Normal file
2
src/utils/history.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
export const getPath = () => (window.location && window.location.pathname &&
|
||||
window.location.pathname.replace(/^\//, ''));
|
7
src/utils/import.js
Normal file
7
src/utils/import.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
functions to parse old maps data
|
||||
*/
|
||||
|
||||
export const parseStickerAngle = ({ angle, format }) => parseFloat((format === 'old' ? angle - 3.14 : angle));
|
||||
|
||||
export const parseStickerStyle = ({ style, format }) => (format === 'old' ? 'green' : style);
|
Loading…
Add table
Add a link
Reference in a new issue