forked from MapComplete/MapComplete
Fix: maproulette import flow
This commit is contained in:
parent
f80054558f
commit
5f7cc351c9
18 changed files with 331 additions and 114 deletions
|
|
@ -72,4 +72,23 @@ export default class Maproulette {
|
|||
throw `Failed to close task: ${response.status}`
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a status text into the corresponding number
|
||||
*
|
||||
* Maproulette.codeToIndex("Created") // => 0
|
||||
* Maproulette.codeToIndex("qdsf") // => undefined
|
||||
*
|
||||
*/
|
||||
public static codeToIndex(code: string) : number | undefined{
|
||||
if(code === "Created"){
|
||||
return Maproulette.STATUS_OPEN
|
||||
}
|
||||
for (let i = 0; i < 9; i++) {
|
||||
if(Maproulette.STATUS_MEANING[""+i] === code){
|
||||
return i
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue