mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 12:07:19 +00:00
Get rid of some console.logs
This commit is contained in:
parent
9b59ae2b73
commit
d518675e03
@ -29,7 +29,6 @@ exports.handler = function(request,response,state) {
|
|||||||
// Get the parameters
|
// Get the parameters
|
||||||
var bag_name = $tw.utils.decodeURIComponentSafe(state.params[0]),
|
var bag_name = $tw.utils.decodeURIComponentSafe(state.params[0]),
|
||||||
bag_name_2 = $tw.utils.decodeURIComponentSafe(state.params[1]);
|
bag_name_2 = $tw.utils.decodeURIComponentSafe(state.params[1]);
|
||||||
console.log(`Got ${bag_name} and ${bag_name_2}`)
|
|
||||||
// Require the bag names to match
|
// Require the bag names to match
|
||||||
if(bag_name !== bag_name_2) {
|
if(bag_name !== bag_name_2) {
|
||||||
return state.sendResponse(400,{"Content-Type": "text/plain"},"Bad Request: bag names do not match");
|
return state.sendResponse(400,{"Content-Type": "text/plain"},"Bad Request: bag names do not match");
|
||||||
|
@ -25,7 +25,6 @@ exports.handler = function(request,response,state) {
|
|||||||
data = $tw.utils.parseJSONSafe(state.data);
|
data = $tw.utils.parseJSONSafe(state.data);
|
||||||
if(recipe_name === recipe_name_2 && data) {
|
if(recipe_name === recipe_name_2 && data) {
|
||||||
const result = $tw.mws.store.createRecipe(recipe_name,data.bag_names,data.description);
|
const result = $tw.mws.store.createRecipe(recipe_name,data.bag_names,data.description);
|
||||||
console.log(`create recipe route handler for ${recipe_name} with ${JSON.stringify(data)} got result ${JSON.stringify(result)}`)
|
|
||||||
if(!result) {
|
if(!result) {
|
||||||
state.sendResponse(204,{
|
state.sendResponse(204,{
|
||||||
"Content-Type": "text/plain"
|
"Content-Type": "text/plain"
|
||||||
|
@ -33,7 +33,6 @@ exports.processIncomingStream = function(options) {
|
|||||||
const parts = []; // Array of {name:, headers:, value:, hash:} and/or {name:, filename:, headers:, inboxFilename:, hash:}
|
const parts = []; // Array of {name:, headers:, value:, hash:} and/or {name:, filename:, headers:, inboxFilename:, hash:}
|
||||||
options.state.streamMultipartData({
|
options.state.streamMultipartData({
|
||||||
cbPartStart: function(headers,name,filename) {
|
cbPartStart: function(headers,name,filename) {
|
||||||
console.log(`Received file ${name} and ${filename} with ${JSON.stringify(headers)}`)
|
|
||||||
const part = {
|
const part = {
|
||||||
name: name,
|
name: name,
|
||||||
filename: filename,
|
filename: filename,
|
||||||
@ -58,7 +57,6 @@ exports.processIncomingStream = function(options) {
|
|||||||
}
|
}
|
||||||
length = length + chunk.length;
|
length = length + chunk.length;
|
||||||
hash.update(chunk);
|
hash.update(chunk);
|
||||||
console.log(`Got a chunk of length ${chunk.length}, length is now ${length}`);
|
|
||||||
},
|
},
|
||||||
cbPartEnd: function() {
|
cbPartEnd: function() {
|
||||||
if(fileStream) {
|
if(fileStream) {
|
||||||
@ -72,7 +70,6 @@ exports.processIncomingStream = function(options) {
|
|||||||
if(err) {
|
if(err) {
|
||||||
return options.callback(err);
|
return options.callback(err);
|
||||||
} else {
|
} else {
|
||||||
console.log(`Multipart form data processed as ${JSON.stringify(parts,null,4)}`);
|
|
||||||
const partFile = parts.find(part => part.name === "file-to-upload" && !!part.filename);
|
const partFile = parts.find(part => part.name === "file-to-upload" && !!part.filename);
|
||||||
if(!partFile) {
|
if(!partFile) {
|
||||||
return state.sendResponse(400, {"Content-Type": "text/plain"},"Missing file to upload");
|
return state.sendResponse(400, {"Content-Type": "text/plain"},"Missing file to upload");
|
||||||
@ -88,7 +85,6 @@ exports.processIncomingStream = function(options) {
|
|||||||
tiddlerFields[part.name.slice(tiddlerFieldPrefix.length)] = part.value.trim();
|
tiddlerFields[part.name.slice(tiddlerFieldPrefix.length)] = part.value.trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(`Creating tiddler with ${JSON.stringify(tiddlerFields)} and ${partFile.filename}`)
|
|
||||||
options.store.saveBagTiddlerWithAttachment(tiddlerFields,options.bagname,{
|
options.store.saveBagTiddlerWithAttachment(tiddlerFields,options.bagname,{
|
||||||
filepath: partFile.inboxFilename,
|
filepath: partFile.inboxFilename,
|
||||||
type: type,
|
type: type,
|
||||||
|
@ -250,7 +250,6 @@ type - content type of file as uploaded
|
|||||||
Returns {tiddler_id:}
|
Returns {tiddler_id:}
|
||||||
*/
|
*/
|
||||||
SqlTiddlerStore.prototype.saveBagTiddlerWithAttachment = function(incomingTiddlerFields,bagname,options) {
|
SqlTiddlerStore.prototype.saveBagTiddlerWithAttachment = function(incomingTiddlerFields,bagname,options) {
|
||||||
console.log(`saveBagTiddlerWithAttachment ${JSON.stringify(incomingTiddlerFields)}, ${bagname}, ${JSON.stringify(options)}`);
|
|
||||||
const attachment_blob = this.attachmentStore.adoptAttachment(options.filepath,options.type,options.hash);
|
const attachment_blob = this.attachmentStore.adoptAttachment(options.filepath,options.type,options.hash);
|
||||||
if(attachment_blob) {
|
if(attachment_blob) {
|
||||||
return this.sqlTiddlerDatabase.saveBagTiddler(incomingTiddlerFields,bagname,attachment_blob);
|
return this.sqlTiddlerDatabase.saveBagTiddler(incomingTiddlerFields,bagname,attachment_blob);
|
||||||
|
Loading…
Reference in New Issue
Block a user