Redirect
This commit is contained in:
parent
80f23b5650
commit
54eb316555
|
@ -660,39 +660,32 @@ class Redirect extends ArticleStub {
|
||||||
|
|
||||||
constructor ( info ) {
|
constructor ( info ) {
|
||||||
super( info )
|
super( info )
|
||||||
|
this.data = null
|
||||||
this.to = info.to
|
this.to = info.to
|
||||||
this.toFragment = info.toFragment
|
this.toFragment = info.toFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
data() {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
mimeId () {
|
mimeId () {
|
||||||
return 0xffff
|
return 0xffff
|
||||||
}
|
}
|
||||||
|
|
||||||
store () {
|
async storeMetadata ( ) {
|
||||||
return null
|
const id = await super.storeMetadata()
|
||||||
}
|
if ( ! id )
|
||||||
|
return
|
||||||
|
const target = new ArticleStub( this.to )
|
||||||
|
const row = [
|
||||||
|
id,
|
||||||
|
target.urlKey(),
|
||||||
|
this.toFragment,
|
||||||
|
]
|
||||||
|
|
||||||
storeMetadata ( ) {
|
log( '>', this.title || this.url, row)
|
||||||
return super.storeMetadata()
|
|
||||||
.then( () => {
|
|
||||||
const target = new ArticleStub( this.to )
|
|
||||||
const row = [
|
|
||||||
this.id,
|
|
||||||
target.urlKey(),
|
|
||||||
this.toFragment,
|
|
||||||
]
|
|
||||||
|
|
||||||
log( '>', this.title || this.url, row)
|
return wiki.db.run(
|
||||||
|
'INSERT INTO redirects (id, targetKey, fragment) VALUES (?,?,?)',
|
||||||
wiki.db.run(
|
row
|
||||||
'INSERT INTO redirects (id, targetKey, fragment) VALUES (?,?,?)',
|
)
|
||||||
row
|
|
||||||
)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user