Type few anys
This commit is contained in:
+2
-2
@@ -43,7 +43,7 @@ class EventApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async createEvent(data: any): Promise<Event> {
|
static async createEvent(data: Event): Promise<Event> {
|
||||||
try {
|
try {
|
||||||
const resp = await axios.post(URL, data, {
|
const resp = await axios.post(URL, data, {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -57,7 +57,7 @@ class EventApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async updateEvent(data: any): Promise<Event> {
|
static async updateEvent(data: Event): Promise<Event> {
|
||||||
try {
|
try {
|
||||||
const putUrl = `${URL}${data.id}/`;
|
const putUrl = `${URL}${data.id}/`;
|
||||||
const resp = await axios.put(putUrl, data, {
|
const resp = await axios.put(putUrl, data, {
|
||||||
|
|||||||
+2
-2
@@ -33,7 +33,7 @@ class FeedApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async createPost(data): Promise<Post> {
|
static async createPost(data: Post): Promise<Post> {
|
||||||
try {
|
try {
|
||||||
const resp = await axios.post(URL, data, {
|
const resp = await axios.post(URL, data, {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -47,7 +47,7 @@ class FeedApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async updatePost(data): Promise<Post> {
|
static async updatePost(data: Post): Promise<Post> {
|
||||||
try {
|
try {
|
||||||
const putUrl = `${URL}${data.id}/`;
|
const putUrl = `${URL}${data.id}/`;
|
||||||
const resp = await axios.put(putUrl, data, {
|
const resp = await axios.put(putUrl, data, {
|
||||||
|
|||||||
+2
-2
@@ -43,7 +43,7 @@ class JobAdApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async createJobAd(data: any): Promise<JobAd> {
|
static async createJobAd(data: JobAd): Promise<JobAd> {
|
||||||
try {
|
try {
|
||||||
const resp = await axios.post(URL, data, {
|
const resp = await axios.post(URL, data, {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -57,7 +57,7 @@ class JobAdApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async updateJobAd(data: any): Promise<JobAd> {
|
static async updateJobAd(data: JobAd): Promise<JobAd> {
|
||||||
try {
|
try {
|
||||||
const putUrl = `${URL}${data.id}/`;
|
const putUrl = `${URL}${data.id}/`;
|
||||||
const resp = await axios.put(putUrl, data, {
|
const resp = await axios.put(putUrl, data, {
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class SignupApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async createForm(data): Promise<SignupForm> {
|
static async createForm(data: SignupForm): Promise<SignupForm> {
|
||||||
try {
|
try {
|
||||||
const resp = await axios.post(FORM_URL, data, {
|
const resp = await axios.post(FORM_URL, data, {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -119,7 +119,7 @@ class SignupApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async updateForm(data): Promise<SignupForm> {
|
static async updateForm(data: SignupForm): Promise<SignupForm> {
|
||||||
try {
|
try {
|
||||||
const putUrl = `${FORM_URL}${data.id}/`;
|
const putUrl = `${FORM_URL}${data.id}/`;
|
||||||
const resp = await axios.put(putUrl, data, {
|
const resp = await axios.put(putUrl, data, {
|
||||||
@@ -148,7 +148,7 @@ class SignupApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async signupFormSendEmail(data, id): Promise<any> {
|
static async signupFormSendEmail(data: any, id: number): Promise<any> {
|
||||||
try {
|
try {
|
||||||
const resp = await axios.post(`${FORM_URL}${id}/sendemail/`, data, {
|
const resp = await axios.post(`${FORM_URL}${id}/sendemail/`, data, {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -162,7 +162,7 @@ class SignupApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async getSignups(id): Promise<Signup[]> {
|
static async getSignups(id: number): Promise<Signup[]> {
|
||||||
try {
|
try {
|
||||||
const resp = await axios.get(`${FORM_URL}${id}/signups/`, {
|
const resp = await axios.get(`${FORM_URL}${id}/signups/`, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ const EventCreatePage: NextPage = () => {
|
|||||||
}
|
}
|
||||||
}, [id]);
|
}, [id]);
|
||||||
|
|
||||||
const onSubmit = async (data) => {
|
const onSubmit = async (data: any) => {
|
||||||
try {
|
try {
|
||||||
const payload = data.formData;
|
const payload = data.formData;
|
||||||
payload.signup_id = payload.signupForm;
|
payload.signup_id = payload.signupForm;
|
||||||
@@ -231,7 +231,7 @@ const EventCreatePage: NextPage = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChange = (data) => setFormData(data.formData);
|
const onChange = (data: any) => setFormData(data.formData);
|
||||||
const onFocus = () => setStatusMessage(null);
|
const onFocus = () => setStatusMessage(null);
|
||||||
const title = formData?.id
|
const title = formData?.id
|
||||||
? `Edit Event "${formData.title_fi}"`
|
? `Edit Event "${formData.title_fi}"`
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ const SignupEmailPage: NextPage = () => {
|
|||||||
const onSubmit = async (data) => {
|
const onSubmit = async (data) => {
|
||||||
try {
|
try {
|
||||||
const payload = data.formData;
|
const payload = data.formData;
|
||||||
await SignupApi.signupFormSendEmail(payload, id);
|
await SignupApi.signupFormSendEmail(payload, Number(id));
|
||||||
setStatusMessage("Email sent successfully");
|
setStatusMessage("Email sent successfully");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(err);
|
setError(err);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noImplicitAny": false, // TODO: switch true
|
||||||
"noUnusedLocals": false, // TODO: switch true
|
"noUnusedLocals": false, // TODO: switch true
|
||||||
"noUnusedParameters": false, // TODO: switch true
|
"noUnusedParameters": false, // TODO: switch true
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user