Continue Upload Script.
Pause during rewrite of RHPZ Server code.
This commit is contained in:
34
ts/submissions/class-set-favorite-server.ts
Normal file
34
ts/submissions/class-set-favorite-server.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import {__, I } from "./globals";
|
||||
declare const _romhackplaza_script_uploader: any;
|
||||
declare const romhackplaza_modal_submissions: any;
|
||||
|
||||
export class Set_Favorite_Server {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param callback - MUST BE FROM A Upload child.
|
||||
*/
|
||||
constructor( server_id: number ){
|
||||
|
||||
this.do_request( server_id );
|
||||
|
||||
}
|
||||
|
||||
private do_request( server_id : number ){
|
||||
|
||||
jQuery.ajax({
|
||||
type: "POST",
|
||||
url: _romhackplaza_script_uploader.submit_url,
|
||||
data: {
|
||||
action: 'set_favorite_server',
|
||||
post_id: I.reserved_post_id,
|
||||
favorite_server: server_id,
|
||||
_wpnonce: _romhackplaza_script_uploader.set_favorite_nonce
|
||||
},
|
||||
success: function(){
|
||||
console.log( "Favorite server set" );
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user