legacy-appointment.js 460 B

123456789
  1. async function prepareLegacyAppointment(order,current) {
  2. // SQL rechecks ownership. Request parameters cannot supply the pricing rules.
  3. try {
  4. return (await Psql.one('SELECT xs_prepare_legacy_appointment($1,$2,$3,$4::jsonb) AS result',
  5. [DEFAULT_COMPANY_ID,order.objectId,current.id,JSON.stringify(legacyAppointmentSeedRules())])).result;
  6. } catch(error) {
  7. return {blockedReason:String(error.message||error).replace(/^.*ERROR:\s*/,'')};
  8. }
  9. }