wa_strapi
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 regels
631 B

  1. "use strict";
  2. /**
  3. * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services)
  4. * to customize this service
  5. */
  6. module.exports = {
  7. getId: async (params) => {
  8. const results = await strapi.query("session-data").find(params);
  9. let arrKeys = [];
  10. results.forEach((i) => {
  11. if (!arrKeys.includes(i["id"])) arrKeys.push(i["id"]);
  12. });
  13. return arrKeys;
  14. },
  15. sessionCheck: async (sessionId) => {
  16. const sessions = await strapi.api["session-data"].services[
  17. "session-data"
  18. ].getId({
  19. _sort: "phonenumber:desc",
  20. });
  21. return sessions.includes(sessionId);
  22. },
  23. };