1
0
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:
Jeremy Ruston 2024-03-15 16:49:24 +00:00
parent 9b59ae2b73
commit d518675e03
4 changed files with 0 additions and 7 deletions

View File

@ -29,7 +29,6 @@ exports.handler = function(request,response,state) {
// Get the parameters
var bag_name = $tw.utils.decodeURIComponentSafe(state.params[0]),
bag_name_2 = $tw.utils.decodeURIComponentSafe(state.params[1]);
console.log(`Got ${bag_name} and ${bag_name_2}`)
// Require the bag names to match
if(bag_name !== bag_name_2) {
return state.sendResponse(400,{"Content-Type": "text/plain"},"Bad Request: bag names do not match");

View File

@ -25,7 +25,6 @@ exports.handler = function(request,response,state) {
data = $tw.utils.parseJSONSafe(state.data);
if(recipe_name === recipe_name_2 && data) {
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) {
state.sendResponse(204,{
"Content-Type": "text/plain"

View File

@ -33,7 +33,6 @@ exports.processIncomingStream = function(options) {
const parts = []; // Array of {name:, headers:, value:, hash:} and/or {name:, filename:, headers:, inboxFilename:, hash:}
options.state.streamMultipartData({
cbPartStart: function(headers,name,filename) {
console.log(`Received file ${name} and ${filename} with ${JSON.stringify(headers)}`)
const part = {
name: name,
filename: filename,
@ -58,7 +57,6 @@ exports.processIncomingStream = function(options) {
}
length = length + chunk.length;
hash.update(chunk);
console.log(`Got a chunk of length ${chunk.length}, length is now ${length}`);
},
cbPartEnd: function() {
if(fileStream) {
@ -72,7 +70,6 @@ exports.processIncomingStream = function(options) {
if(err) {
return options.callback(err);
} 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);
if(!partFile) {
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();
}
}
console.log(`Creating tiddler with ${JSON.stringify(tiddlerFields)} and ${partFile.filename}`)
options.store.saveBagTiddlerWithAttachment(tiddlerFields,options.bagname,{
filepath: partFile.inboxFilename,
type: type,

View File

@ -250,7 +250,6 @@ type - content type of file as uploaded
Returns {tiddler_id:}
*/
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);
if(attachment_blob) {
return this.sqlTiddlerDatabase.saveBagTiddler(incomingTiddlerFields,bagname,attachment_blob);