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.

83 lines
2.1 KiB

const fastify = require("fastify");
const validationHandler = require("../handlers/friendRequestHandler");
module.exports = function (fastify, opts, next) {
fastify.route({
method: "POST",
url: "/api/users/friend-request",
schema: {
tags: ["Friend-Request"],
description: "This is for User Friend Request",
summary: "This is for User Friend Request",
body: {
type: "object",
//required: ["customerId"],
properties: {
customerId: { type: "string" },
supplierId : { type : "string"}
},
},
security: [
{
basicAuth: [],
},
],
},
handler: validationHandler.friendRequest,
});
fastify.route({
method: "PUT",
url: "/api/friend-request/accept",
schema: {
tags: ["Friend-Request"],
description: "This is for supplier accept the friend request",
summary: "This is for supplier accept the friend request",
body: {
type: "object",
properties: {
supplierId: { type: "string" },
customerId: { type: "string" }
},
},
security: [
{
basicAuth: [],
},
],
},
handler: validationHandler.friendRequestAccept
});
fastify.route({
method: "PUT",
url: "/api/friend-request/reject",
schema: {
tags: ["Friend-Request"],
description: "This is for supplier reject the friend request",
summary: "This is for supplier reject the friend request",
body: {
type: "object",
properties: {
supplierId: { type: "string" },
customerId: { type: "string" }
},
},
security: [
{
basicAuth: [],
},
],
},
handler: validationHandler.friendRequestReject
});
next();
}