PaoGon / R.I.M.

0 stars 1 forks source link

Report validation on backend #81

Closed PaoGon closed 1 year ago

PaoGon commented 1 year ago

How to replicate

expected behavior:

suggestion:

jlozion026 commented 1 year ago

Sige sige paps, tinry ko last time ivalidate din kasama location, may nakukuha akong error nun last time, pero need ko lang imbestigahan mabuti

PaoGon commented 1 year ago

patingin ako ng error na nakukuha mo, ss mo dito

PaoGon commented 1 year ago

eto pala

      const isReport = await ctx.prisma.report.findFirst({
        where : {
          AND: [
            {description: args.data.description},
            {report_type: args.data.report_type},
          ]
        }
      })
      if (isReport) {
        throw new ApolloError("Report Already Exist")
      }

Originally posted by @jlozion026 in https://github.com/PaoGon/thesis/issues/63#issuecomment-1384757096

PaoGon commented 1 year ago

eto pala

      const isReport = await ctx.prisma.report.findFirst({
        where : {
          AND: [
            {description: args.data.description},
            {report_type: args.data.report_type},
          ]
        }
      })
      if (isReport) {
        throw new ApolloError("Report Already Exist")
      }

Originally posted by @jlozion026 in #63 (comment)

di ba na gana dito yung

        where : {
          AND: [
            {description: args.data.description},
            {report_type: args.data.report_type},
            {report_type: args.data.location},
          ]
        }

@jlozion026

jlozion026 commented 1 year ago

Ayan, ganyan yung ginawa ko nooon HAHAHAH

PaoGon commented 1 year ago

Ayan, ganyan yung ginawa ko nooon HAHAHAH

hmmm, possible kasi na di nya ala myung type ng location since json yung type nyan kaya nag error pero patingin narin ng error message