diff --git a/wrenchboard/src/shared_tool/jobs.cc b/wrenchboard/src/shared_tool/jobs.cc index 6da9d777..0e8b3035 100644 --- a/wrenchboard/src/shared_tool/jobs.cc +++ b/wrenchboard/src/shared_tool/jobs.cc @@ -104,15 +104,13 @@ long jobs_calls(CVars in, CVars &out) { long WrenchJobPostAgree(CVars in, CVars &out) { long member_id = REQ_LONG(in, "member_id", 1, -1); - long message_id = REQ_LONG(in, "message_id", 1, -1); + REQ_STRING(in, "uid", 1, 500, "(.*)"); //uid - REQ_STRING(in, "yourmessage", 1, 500, "(.*)"); //offer_code - REQ_STRING(in, "memo", 1, 15, "(.*)"); //offer_code + if (load_db_record(out, "SELECT * FROM members WHERE id = %lu AND uid='%s' AND post_jobs IS NULL", in["message_id"].Long(), in["uid"].c_str()) { + pgsql_exec("UPDATE members SET post_jobs = now() WHERE id = %lu AND uid='%s'", in["message_id"].Long(), in["uid"].c_str()); + } - - - - logfmt(logINFO, "/WrenchReplyMessage()"); + logfmt(logINFO, "/WrenchJobPostAgree()"); return 0; }