Skip to content

Cannot upload lambda function from UI #7

Description

@bifocalpirate

In FunctionCreateDialog.tsx the shape of the payload created in createFunction below

		createFunction.mutate(
			{
				functionName: functionName.trim(),
				runtime,
				handler: handler.trim(),
				role: role.trim(),
				memorySize,
				timeout,
				code:  zipFile , //base64 of uploaded zip
			},
			{
				onSuccess: () => {
					resetForm();
					onOpenChange(false);
				},
			},
		);

does not align with the expected shape of the working test case.

expect(mockMutate).toHaveBeenCalledWith(
				{
					functionName: "my-function",
					runtime: "nodejs20.x",
					handler: "index.handler",
					role: "arn:aws:iam::000000000000:role/my-role",
					memorySize: 128,
					timeout: 30,
					code: expect.objectContaining({ zipFile: expect.any(String) }),
				},
				expect.any(Object),
			);

This causes an invalid request error when the zipfile is uploaded, it cannot find the uploaded code as it is uploaded as a value of code instead of zipFile which is in the child object of code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions