This commit is contained in:
v 2018-11-28 18:37:44 +03:00
parent 80f23b5650
commit 54eb316555

View File

@ -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
)
})
} }
} }