Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cf-pages committed Jan 18, 2023
1 parent e15b3ab commit 86fb2bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions/file/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function onRequest(context) { // Contents of context object
return response;
}

if (env.img_url){
if (typeof env.img_url == "undefined" || env.img_url == null || env.img_url == ""){
//check the record from kv
const record = await env.img_url.getWithMetadata(params.id);
console.log("record")
Expand Down Expand Up @@ -69,7 +69,7 @@ export async function onRequest(context) { // Contents of context object

if(typeof apikey == "undefined" || apikey == null || apikey == ""){

if (env.img_url){
if (typeof env.img_url == "undefined" || env.img_url == null || env.img_url == ""){
//add image to kv
await env.img_url.put(params.id, "",{
metadata: { ListType: "None", Label: "None",TimeStamp: time },
Expand All @@ -85,7 +85,7 @@ export async function onRequest(context) { // Contents of context object
console.log(moderate_data)
console.log("---env.img_url---")
console.log(env.img_url=="true")
if (env.img_url){
if (typeof env.img_url == "undefined" || env.img_url == null || env.img_url == ""){
//add image to kv
await env.img_url.put(params.id, "",{
metadata: { ListType: "None", Label: moderate_data.rating_label,TimeStamp: time },
Expand Down

0 comments on commit 86fb2bd

Please sign in to comment.